namco
Alienbutserious
- Joined
- Sep 5, 2010
- Messages
- 148
- Solutions
- 2
- Reaction score
- 38
I need some help, please.
When the player logs out, the Storage won't turn back to its normal state because the addEvent won't trigger.
What should I do?
When the player logs out, the Storage won't turn back to its normal state because the addEvent won't trigger.
What should I do?
Lua:
showWayshrine = MoveEvent()
local function cooldown(playerId)
local player = Player(playerId)
if not player then
return
end
player:setStorageValue(1000, 0)
end
function showWayshrine.onStepIn(creature, item, position, fromPosition)
local player = Player(creature:getId())
local wayshrinePosition = Position(966, 958, 7)
if not creature:isPlayer() then
return true
end
if player:getStorageValue(1000) == 1 then
return true
end
wayshrinePosition:sendMagicEffect(56)
wayshrinePosition:sendMagicEffect(57)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Right-click the stone pillar to use the wayshrine.")
addEvent(cooldown, 10000, player:getId())
return true
end
showWayshrine:aid(1000)
showWayshrine:register()