
02-16-2008, 12:19 AM
|
|
Registered User
|
Join Date: Jun 2006
Posts: 35
|
|
Newbie Scripter seeks line-by-line breakdown
|
//#CLIENTSIDE
function onCreated()
Why onCreated() and not just Created()? What does "on" do?
setTimer(0.1);
What is the timer used for? and if it's declared within a function, why not just call the function for later use?
function onTimeout() {
What is the difference between "setTimer" and "onTimeout"?
// or whatever to detect if it's not held down
if (!keydown(5)) this.canhit = true;
Does this mean if whatever key '5' represents, pressing the opposite will activate "this.canhit = true;"? And what does that part mean?
setTimer(0.1);
Couldn't the whole function be called?
}
function onKeyPressed(code, key) {
Are "code" and "key" some sort of preset parameters or something? What do those mean? Cause I don't see them defined anywhere..
switch (lowercase(key)) {
Is capslock relevant here, or is this for something else?
case "s":
I remember case's from C++, but the next part is what troubles me..
if (this.canhit) {
Is this still asking if while it is true?
player.chat = "s";
So if "this.canhit" was set to true, then it makes the player say "s"? But then how is this.canhit even determinded? By pressing any key other than '5'?
this.canhit = false;
And I'm guessing that absolutely nothing happens if this.canhit is false, cause there's nothing after it except closing brackets
}
break;
And this simply halts the script? no?
}
}
Sorry to whomever takes the time out to read through and answer this post, but I'm really trying to learn this stuff. I find gs2 quite fascinating. |
|
|
|