UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How to set a variable

broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
1,614 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
how do i make a new variable. So i want a variable to be called number and be set to  0 when the script starts

and after the player hits a trigger i want teh number to be 1 and do a inprint.

like this

Code Snippet
Plaintext
iprintln("Connection %i Stable", number);

so would that work.

all i basiclyt want to know is how do i defined a variable in the beginig.

Cause i know in Objective C. you can do this to create a variable.

Code Snippet
Plaintext
int number = 0;
Marked as best answer by pashan 12 years ago
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
You can just do:


Code Snippet
Plaintext
trigger = getent( "triggername" , "targetname");

var = 0;

while(1)
{
trigger waittill( "trigger" );

var++;

if( var == 1 )
{
Iprintln( ..... );
break; ( this will end the while loop once the var is 1, and the message is printed)
}

wait 0.1;
}
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
var = 0;

thats all you need. quotations automatically makes it a string and no quotations makes it an int

 
Loading ...