So I have this script, I know its not the most effecient, but I am still learning. I am having trouble using the triggeractions, obviously, and also getting it to only effect the player who grabbed the safe.
I have this in the class:
PHP Code:
function onActionServerside() {
player.guild = "Robbing!";
playerrupees += 1000;
}
//#CLIENTSIDE
function onCreated()
{
for (pl:allplayers) {
if (player.guild = "test") {
player.chat = "Alert:" SPC player.account SPC "is robbing the safe at" SPC player.level;
}
}
robbing = false;
setTimer(0.05);
new GuiProgressCtrl("Rob_Progress") {
profile = GuiBlueProgressProfile;
x = 0;
y = 0;
width = 160;
height = 20;
progress = 0;
visible = false;
}
new GuiButtonCtrl("Cancel_Button") {
profile = GuiBlueButtonProfile;
x = 170;
y = 0;
width = 50;
height = 20;
text = "Abort";
visible = false;
}
}
if (robbing = false) {
function onTimeout() {
Rob_Progress.visible = true;
Cancel_Button.visible = true;
setTimer(0.05);
disabledefmovement;
robbing = true;
Rob_Progress.progress += 0.01;
timeout=0.05;
//player.chat = Rob_Progress.progress;
setTimer(0.05);
if (Rob_Progress.progress = 1) {
setTimer(0);
enabledefmovement;
Rob_Progress.visible = false;
Cancel_Button.visible = false;
player.chat = "Sucessfully robbed the safe!";
//triggeraction(0,0,"serverside",onTimeout);
}
}
}
function Cancel_Button.onAction() {
if (robbing = true) {
robbing = false;
enabledefmovement;
setTimer(0);
player.chat = "Aborted robbery!";
sleep(1);
Rob_Progress.visible = false;
Cancel_Button.visible = false;
}
}