Blockland Forums > Modification Help
CityRP Help
Blaze0:
I'm currently editing Jookia's CityRP (no hunger mod, clothes or fancy stuff of the sort). I need to know how to use variables in TorqueScript. I want it so when a user places a lot, it sets a variable to 1. If all of the users lots are removed (having no lots) the variable switches to 1. This is always clientsided so the only way to change the variable is from changing your number of lots to and from zero. Another thing. I need the variable to be testable (ifVariable) through VCE events. When VCE comes out, I will be able to stop other players from using this variable for safety.
One last thing. How do I prevent events from functioning for NON ADMINS?
Thanks.
::Matt:::
Variables:
--- Code: ---%(local Variable)
$(global Variable)
--- End code ---
If the player is not an admin and you don't want him to do the function...
You must have client as a variable, then...
--- Code: ---if(!%client.isAdmin || %client.isSuperAdmin)
return
--- End code ---
Blaze0:
I'm really new to TorqueScript, so 3 questions:
1, what's the difference between Local and Global variables?
2, what does return do?
3, are the variables editable through VCE?
otto-san:
--- Quote from: Blaze0 on January 25, 2011, 10:28:54 PM ---I'm really new to TorqueScript, so 3 questions:
1, what's the difference between Local and Global variables?
2, what does return do?
3, are the variables editable through VCE?
--- End quote ---
1. Local is within a function or assigned to an object. Global is, like, server prefs and things like that.
2. i cant really explain it, can someone else do that? ._.'
3. no, vce variables work differently.
edit:
Torque is not going to come so easily as you seem to want it to. It takes time, but we'd be glad to help you get on your feet.
Blaze0:
I need it checkable through VCE (IfVariable)