package Chatbot{ $wins = 0; $losses = 0; function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) { parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); if(%name !$= $Pref::Player::NetName) return; } if(%msg $= "RPSBot" && getWordCount(%msg) == 2) { %attack[1] = "rock"; %attack[2] = "scissors"; %attack[3] = "paper"; $fattack = random($attack) $word = getWord(%msg,2); switch$(%word) { case "rock" { if($fattack $= "rock" { commandToServer('messageSent',"We both chose rock.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses."); } if($fattack $= "scissors"; { commandToServer('messageSent',"Man, I lost. I chose scissors. You have "@$wins@" wins and "@$losses@" losses."); $wins += 1; } if($fattack $= "paper"; { commandToServer('messageSent',"Yay! I chose paper! You have "@$wins@" wins and "@$losses@" losses"); $losses += 1; } case "scissors" { if($fattack $= "rock" { commandToServer('messageSent',"Yay! I chose rock! You have "@$wins@" wins and "@$losses@" losses."); $losses += 1; } if($fattack $= "scissors"; { commandToServer('messageSent',"We both chose scissors.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses."); } if($fattack $= "paper"; { commandToServer('messageSent',"Man, I lost. I chose paper. You have "@$wins@" wins and "@$losses@" losses"); $wins += 1; } case "paper" { if($fattack $= "rock" { commandToServer('messageSent',"Man, I lost. I chose rock. You have "@$wins@" wins and "@$losses@" losses."); $wins += 1; } if($fattack $= "scissors"; { commandToServer('messageSent',"Yay! I chose scissors! You have "@$wins@" wins and "@$losses@" losses."); $losses += 1; } if($fattack $= "paper"; { commandToServer('messageSent',"We both chose paper.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses"); } } } }
Restart blockland and try again.
nothing happened..?
Do not define variable inside the package that's not inside a function and restart bl.
I like how you quoted the part where he told you exactly what you were doing wrong and you didn't fix it
dude it's like that i'm not kiddingin the script file-snip-but in the consoleit doesn't have a p
are you dumb or something?TAKE THE VARIABLE DECLARATIONS OUT OF THE PACKAGE AND TRY AGAIN
He doesn't know how to script. He's closing if statements with semicolons.I'll have to take a look through this tommorow to get out all the errors.
$wins = 0;$losses = 0;package Chatbot{ function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) { parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); if(%name !$= $Pref::Player::NetName) return; if(%msg $= "RPSBot" && getWordCount(%msg) == 1) { %attack[1] = "rock"; %attack[2] = "scissors"; %attack[3] = "paper"; $fattack = random($attack) $word $= getWord(%msg,2); switch$($word) { case "rock" { if($fattack $= "rock") { commandToServer('messageSent',"We both chose rock.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses."); } if($fattack $= "scissors") { commandToServer('messageSent',"Man, I lost. I chose scissors. You have "@$wins@" wins and "@$losses@" losses."); $wins += 1; } if($fattack $= "paper") { commandToServer('messageSent',"Yay! I chose paper! You have "@$wins@" wins and "@$losses@" losses"); $losses += 1; } case "scissors" { if($fattack $= "rock") { commandToServer('messageSent',"Yay! I chose rock! You have "@$wins@" wins and "@$losses@" losses."); $losses += 1; } if($fattack $= "scissors") { commandToServer('messageSent',"We both chose scissors.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses."); } if($fattack $= "paper") { commandToServer('messageSent',"Man, I lost. I chose paper. You have "@$wins@" wins and "@$losses@" losses"); $wins += 1; } case "paper" { if($fattack $= "rock") { commandToServer('messageSent',"Man, I lost. I chose rock. You have "@$wins@" wins and "@$losses@" losses."); $wins += 1; } if($fattack $= "scissors") { commandToServer('messageSent',"Yay! I chose scissors! You have "@$wins@" wins and "@$losses@" losses."); $losses += 1; } if($fattack $= "paper") { commandToServer('messageSent',"We both chose paper.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses"); } } } }
Go read this, you have absolutely no idea what you're doing
That didn't help me solve the problem at all.I need help with line 16.as it says in the console.But I do not know a way to fix it so somebody help