Blockland Forums > Modification Help

Incorrect script, need fixing

Pages: (1/4) > >>

BBOY:

Hi, before you say anything this is for a friend, he trys to run a script, but it wont work on his server, It is a script for mini empires, The script is:
 function serverCmdRollDice(%client)
{
%r = getRandom(1, 5);
if(%r % 2)
messageall('', "\c3" @ %client.getplayername() @ "\c6 rolled \c3" @ %r @ "\c6! Hit!");
else
messageall('', "\c3" @ %client.getplayername() @ "\c6 rolled \c3" @ %r @ "\c6! Miss!");
}



He siad ottosparks gave it to him.

phflack:

try if(%r % 2 == 0) instead of if(%r % 2)
edit: instead of %client.getplayername() try %client.name

Headcrab Zombie:

Nothing is wrong with the code, its packaged incorrectly or not enabled or something similar.

adam savage:

function serverCmdRollDice(%client)
{
%r = getRandom(1, 5);
if(%r == 2)
messageall('', "\c3" @ %client.name() @ "\c6 rolled \c3" @ %r @ "\c6! Hit!");
else
messageall('', "\c3" @ %client.name() @ "\c6 rolled \c3" @ %r @ "\c6! Miss!");
}

Chrono:

Please stop trying to fix it.


--- Quote from: Headcrab Zombie on December 30, 2011, 02:51:22 PM ---Nothing is wrong with the code, its packaged incorrectly or not enabled or something similar.

--- End quote ---

In fact, adam savage's code wouldn't even work.

Pages: (1/4) > >>

Go to full version