Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   [Help] Password Protected Door (https://forums.graalonline.com/forums/showthread.php?t=134259466)

iSlayer 06-11-2010 10:27 AM

[Help] Password Protected Door
 
Hey guys what codes would I need to make a password protected door? I am not very good at scripting so I need some help!

Would it be like:

FunctionPlayerChats()
{
"password here"
setlevel2=secret.nw
}

I know it's horrible x-x, can someone help me fix it up?

iSlayer 06-11-2010 10:31 AM

This script would probably stuff up graal because it's so bad

cbk1994 06-11-2010 11:20 AM

PHP Code:

function onPlayerChats() {
  if (
player.chat == "the password") {
    
player.setLevel2("mylevel.nw"3232);
  }


I feel bad giving code without explaining it but I think you need to learn the basics of scripting first or you wouldn't understand the explanation anyway.

iSlayer 06-11-2010 11:41 AM

Well I was close! Just missing some (

LordSquirt 06-11-2010 01:01 PM

I like your dedication

Gothika 06-11-2010 03:03 PM

Quote:

Originally Posted by iSlayer (Post 1581350)
This script would probably stuff up graal because it's so bad

Just work on your if statements a bit then you'll get the hang of things.

Fulg0reSama 06-11-2010 04:29 PM

I feel like explaining it for him

PHP Code:

function onPlayerChats() {
  if (
player.chat == "the password") {
    
player.setLevel2("mylevel.nw"3232);
  }


Now function onPlayerChats is self explainitory for the function is of when a player is to speak.
the if statement is where the condition for your doors password is set.

In this case if you were to say "the password" or whatever you set it to.
Your players level would then be set to the level, x and y coordinates in said level.

Hope this helps you understand it a bit more.

Tigairius 06-11-2010 05:23 PM

Here's a fun example of keeping a password secure. Let's say you have a password, "test" and you don't want any other scripter to know that the password is "test." You could do:
PHP Code:

function onPlayerChats() {
  if (
md5(player.chat) == "098f6bcd4621d373cade4e832627b4f6") {
    
setlevel2("testlevel.nw"3030);
  }


Now simply say "test", and it'll warp you to testlevel.nw. Since there is no way to "decrypt" md5 other than brute force, this is a secure way to store odd passwords such as the password "aU4vOlz1" since they are not easily brute forced.

If you want to know the md5 of a string, you can do echo(md5("test"));

Mark Sir Link 06-11-2010 05:46 PM

http://tools.benramsey.com/md5/

Tigairius 06-11-2010 05:48 PM

Quote:

Originally Posted by Mark Sir Link (Post 1581390)

Which is a "rainbow table", not an actual decryption. Rainbow tables are large databases of words that have been encrypted into md5 and the word + the hash is stored, so if someone searches for the word, it can find the hash. It's not applicable for "decrypting" passwords that are unique though, like the one I stated above, "aU4vOlz1". It will only return results for stupid passwords like "cat", "dog", "1111", "1112" etc.

Loriel 06-27-2010 11:48 PM

great, keep advertising obsolete hash functions because they might not break down retardedly in your specific use case maybe


All times are GMT +2. The time now is 08:49 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.