I've been trying to get this old Roulette Bot Working but i have no Idea what to do. I've Looked into Torque scripting and all that stuff and i couldn't seem to find anything Wrong with the Script. Maybe its my lack of Experience or something but i'd appreciate it if someone could help me.
Thanks in Advance :)
//Made by ThinkInvisible, BLID 14511. NOTE : Some things in this code are misplaced so you don't just grab it and use it. This is only an example.
package rouletteBot {
$rouletteBarrel = getrandomnum(1,6);
$rouletteScoreCombo = 0;
$rouletteLastShoot = NaN;
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if (striPos(%msg,"Roulette") > 0) {
if (striPos(%msg,"shoot me") > 0) {
if ($rouletteLastShoot != %name) {
commandToServer('messageSent',%name@" spins the barrel and pulls the trigger...");
%tempval = getrandomnum(1,6);
if (%tempval = $rouletteBarrel) {
$rouletteScore[%name] ++;
export("$rouletteScore*","add-ons/client_roulette/scores.cs");
$rouletteLastShoot = NaN;
$rouletteBarrel = getRandomNum(1,6);
commandToServer('messageSent',"*BLAM*... "@%name@" got hit! "@%name@" has been hit "@$rouletteScore[%name]@" times.");
} else {
commandToServer('messageSent',"*Chk*... "@%name@" escaped the bullet! Good job!");
$rouletteLastShoot = %name;
}
} else {
commandToServer('messageSent',"Silly "@%name@", you can't shoot twice in a row! Let somebody else have a turn, please.");
}
}
}
};