<event type="think" name="NAME" event="script" value="HERE NAME.lua"/>
registerCreatureEvent(cid, "NAME")
function onThink(cid, interval)
local storage = 2000
local value = 100
if getPlayerStorageValue(cid, storage) == value then
doBroadcastMessage('Player '..getCreatureName(cid)..' done quest, Congratulations!')
setPlayerStorageValue (cid, storage, 0)
end
return true
end
That will spam the broadcast, you should reset the storage after execution.creaturescripts.xml
XML:<event type="think" name="NAME" event="script" value="HERE NAME.lua"/>
creaturescripts->scripts->login.lua
LUA:registerCreatureEvent(cid, "NAME")
LUA:function onThink(cid, interval) local storage = 2000 local value = 100 if getPlayerStorageValue(cid, storage) == value then doBroadcastMessage('Player '..getCreatureName(cid)..' done quest, Congratulations!') end return true end
Yea thats right.That will spam the broadcast, you should reset the storage after execution.
well reseting the storage would make it possible for the player to do the quest again?That will spam the broadcast, you should reset the storage after execution.
setPlayerStorageValue (cid, storage, value+1)
Changing the value other than 100 would be I am sure a desired result.well reseting the storage would make it possible for the player to do the quest again?
Anyway would be better to set the storage to 101 when the msg has been broadcasted
LUA:setPlayerStorageValue (cid, storage, value+1)