Blockland Forums > Modification Help
My scripting problems: 0
Sammygood:
I am getting better at torque script, though still some problems. Here they are(list will be updated regularly):
1. I was quickly making a script for toggling a special mode, when i found it came up with a syntax error. I have commented where it is, though i have no idea how there could be an error there (the '}' symbol). Here it is: Fixed. Thanks to Pew446.
Thanks in advance to anybody who helps.
Red_Guy:
a lot of the addons have commandToServer and commandToClient functions in them. you can open the zip file and look.
What are you trying to do?
What have you tried to do?
and what happens? (other than 'it doesnt work')
Sammygood:
I have looked at them. The only way i can get it to work is when i copy/paste and change the script. When i try... OH sorry, it was a simple mistake :). Anyway, thanks for posting! Sorry for wasting your time :(
Amade:
3.
client.cs
--- Code: ---function clientCmdPing()
{
commandToServer('Pong');
}
--- End code ---
server.cs
--- Code: ---function serverCmdPong(%client)
{
%client.pong = 1;
}
commandToClient(findClientByName("bob"), 'ping');
--- End code ---
4. getSimTime() returns the time in milliseconds since Blockland loaded. It's a stable way to check the exact time at which an event occured.
Kalphiter:
--- Quote from: Amade on June 01, 2010, 02:16:35 PM ---It's a stable way
--- End quote ---
I'm guessing you mean that it's not thrown off like schedule() through lag?