![]() |
Variables
Ok im slowly learning how to script , im kinda stuck on varibles... when do you use them??
In the example they use in npcprogramming myvar = 1; if (myvar==1) {..........} So if the varible ='s 1 then the command in {.....} will be executed...... but lets say the command in the {...} was messageHello; then why not just put If (playertouchsme) messageHello; ??? Or 'playerenters' [edit]Also what do these symbols mean >,<,>=,<=,==,!= , or when do you use them?[/edit] |
Re: Variables
Quote:
> - greater than < - less than >= - greater than or equal to <= - less than or equal to == - is equal to != - not equal to (I dont think exists) |
well lets see
you can use variables with flags for certain things, here is a example: NPC Code: >= - great than or equal to > - greater than <= - less than or equal to < - less than == - equal to != - not equal to if you want to check if a variable is greater than, less than, minimum about (greater than or equal to), maximum number (lesser than or equal to), equal to, or any other number |
Re: Re: Variables
Quote:
|
Quote:
NPC Code: :D I know you can do that, I just wanna confooze him ... |
that not nice
|
Re: Re: Re: Variables
Quote:
|
Quote:
|
Re: Variables
Quote:
|
Quote:
|
Quote:
this.variable={0,1,2,3,4,5} The above sets the arrays for the variable 'this.variable'. To access the arrays you use: if (this.variable[1]=value) {} Roughly, that says, if the array 1 of this.variable is equal to a value the contents of {} occur. Arrays start at 0. So the arrays for that variable would be: this.variable[0]=0 this.variable[1]=1 this.variable[2]=2 And so on... |
:eek:
That helped a bit , thanks. Still a little confuseing though :( |
Quote:
If the player touches the npc and the varible is equal the the amount of ruppees , if the varible is equal to 0 then say You have no gralats , if the varible is equal to 1 then the message is You have 1 gralat, if the varible is greater then 2 message is You have (then i dont know what #v is) the amount the varible is gralets. then sleep for 3.4 secs and the message is nothing... Am i right? [edit] Could someone also give me more examples of things with myvar stuff in them?? I want to get this section in scripting down before i go to this.var stuff... [/edit] |
Quote:
|
baby acid, you are right
the #v this is a variable, if you didnt include that, then it would just show, You have myvar gralats but when you put, #v(myvar), it reads myvar and outputs the amount of it |
Okay. I am just completely lost. What is it that whipenie is trying to do and can you re-explain that whole bit about variables and stuff.
|
Quote:
if anyone needs firther help i made this ... http://nyght.digitalrice.com/variables.php |
good definition of arrays, read it, and i am sure u'll undertstand.
NPC Code: |
Hey I started this fad about not knowing how to script right?
[edit]And I still don't get what that rain script means at all! Somoene make an example that a two year old could understand! Because I'm ****ing lost.. [/edit] |
lol. That last post he did finished me off.
|
jesbus.. HELP US PEOIPLES!
aim++ ramsey1337 ;) |
| All times are GMT +2. The time now is 06:05 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.