Blockland Forums > Modification Help
Crashing Code?
(1/2) > >>
Azure:
Okay, so I am *cough*REALLY*cough* new to scripting, and I was trying to make it to where if someone says /sing, a message would pop up on everyone's screen saying,

'IT'S FRIDAY! FRIDAY! GONNA GET DOWN ON FRIDAY! Everybody's lookin' forward to the weekend, week... oh, you guys can see this. D:'.

I thought it would work because it executed right (For once.) But when I typed in /sing, Blockland CRASHED. A second after I typed it it CRASHED.

Can you figure out why it CRASHED me? ._.   This hasn't happened to me on my scripting adventures before.

This is the script -


--- Quote ---function serverCmdsing(%client) {
   commandToServer("","<color:ffffff>IT'S FRIDAY! FRIDAY! GONNA GET DOWN ON FRIDAY! Everybody's lookin' forward to the weekend, week... oh, you guys can see this. D:");
}
--- End quote ---

(Line commandToServer("","(messagething)") is one line, meaning the line after it is part of it by the way...)
FFSO:
You never do a commandToServer for a messageDialog thing. Use MessageBoxOK which is used in the city RPG code.
Electrk:
Why the hell would you even want this?!
otto-san:
commandToServer's first argument should always be in tags.

Doing quotes will cause you to crash.
Headcrab Zombie:
What otto said is the reason why it crashed, but there's a few other reasons why it won't work
1. commandToServer sends a command to the server, you want to send a command to all clients
2. The first argument for command to server is blank
3. If you want to make a pop up, use commandToAll('messageBoxOK',"message");


--- Code: ---function serverCmdsing(%client)
{
    commandToAll('messageBoxOK',"<color:ffffff>IT'S FRIDAY! FRIDAY! GONNA GET DOWN ON FRIDAY! Everybody's lookin' forward to the weekend, week... oh, you guys can see this. D:");
}
--- End code ---
Navigation
Message Index
Next page

Go to full version