Ok so the tnt will only work if you equip it then unequip it and say /tnt
PHP Code:
function onActionServerside()
{
if (params[1] == "use"){
if (clientr.toolcount == NULL) clientr.toolcount = 0;
this.ok = 0;
for (i = 0; i < clientr.toolcount; i ++) {
if (makevar("clientr.tool" @ i)[1] == "Tools/TNT") this.ok = 1;
}
if (this.ok == 0) return;
if (!player.level.name.starts("at_mine")) return;
serverr.tntlayer = player.account;
putnpc2(player.x, player.y, "").join("tnt");
this.temp = { 1, "Tools/TNT", "tnt","at_tnt-icon.png", "", "", 1,};
if (clientr.toolcount == "") clientr.toolcount = 0;
if (this.temp[5] == 1) {
for (i = 0; i < clientr.toolcount; i ++) {
if (makevar("clientr.tool" @ i)[1] == this.temp[1]) {
if (makevar("clientr.tool" @ i)[4] == this.temp[4]) {
makevar("clientr.tool" @ i)[0] -= 1;
if (makevar("clientr.tool" @ i)[0] <= 0) {
makevar("clientr.tool" @ i) = "";
for (j = i; j <= clientr.toolcount; j++) {
makevar("clientr.tool" @ j) = makevar("clientr.tool" @ j + 1);
}
clientr.toolcount--;
}
}
}
}
}
}
}
//#CLIENTSIDE
function onCreated() setTimer(.05);
function onPlayerChats()
{
if (player.chat == "/tnt") {
if (this.timer <= 0) {
triggeraction(0,0,"serverside",Tools/TNT,"use");
this.timer = 2;
} else player.chat = "You must wait " @ this.timer @ "seconds!";
}
}
function onTimeout()
{
if (this.timer > 0) this.timer -=.05;
else if (this.timer < 0) this.timer = 0;
setTimer(.05);
}