[Creature Event]
This event should check to see if the players storage values and global event storages are met, THEN do the following commands.
None of the script works, I am on 8.6, the rest of my entire event works though! i plan to share it with everyone as soon as i can get it working!
The format of my code is all correct, i just cannot see what i am missing!
any help will be greatly appreciated! thank you
Forgot to mention :i am getting NO console errors :l just not working
This event should check to see if the players storage values and global event storages are met, THEN do the following commands.
Code:
local startstorage = 87381
local amountofplayers = 87382
local playing = 87383
local winner = 87384
local over = 87385
local started = 87386
function onThink(cid, interval)
if not isPlayer(cid) or getPlayerGroupId(cid) >= 3 then
return
end
if getCreatureStorage(cid, playing) == 1 and
getCreatureStorage(cid, winner) == 1 then
doPlayerAddItem(cid,9971, 4)
setGlobalStorageValue(startstorage, 0)
setGlobalStorageValue(amountofplayers, 0)
setGlobalStorageValue(over, 1)
doCreatureSetStorage(cid, winner, 0)
doBroadcastMessage("The minigame is over! We have our winner!", MESSAGE_STATUS_WARNING)
return true
end
if getGlobalStorageValue(over) == 1 and
getCreatureStorage(cid, playing) == 1 then
doPlayerAddItem(cid,9971, 2)
setGlobalStorageValue(over, 0)
doCreatureSetStorage(cid, playing, 0)
doPlayerPopupFYI(cid, "Thank you for participating! Tokens have been added to your inventory")
doTeleportThing(cid, {x = 32369, y = 32241, z = 7})
setGlobalStorageValue(started, 0)
return true
end
if getGlobalStorageValue(startstorage) == 1 and
getGlobalStorageValue(amountofplayers) == 5 and
getGlobalStorageValue(started) == 0 and
getCreatureStorage(cid, playing) == 1 then
doTeleportThing(cid, {x = 32489, y = 32376, z = 7})
setGlobalStorageValue(started, 1)
doBroadcastMessage("We have 5 players! Our minigame has begun!", MESSAGE_STATUS_WARNING)
return true
end
end
None of the script works, I am on 8.6, the rest of my entire event works though! i plan to share it with everyone as soon as i can get it working!
The format of my code is all correct, i just cannot see what i am missing!
any help will be greatly appreciated! thank you
Forgot to mention :i am getting NO console errors :l just not working
Last edited: