T
Tibia Demon
Guest
i try to check all the 3 storage here in same time. it only check 1.
i already add actionid to all grounds = 40490
i use cplayerpos later dont need to remove it.
i already add actionid to all grounds = 40490
i use cplayerpos later dont need to remove it.
Lua:
local storagechecker = MoveEvent()
storagechecker:type("stepin")
local actionId = 40490
local Storagetable = {
[1] = {storage = 20115, cplayerpos = {x = 1011, y = 1012, z = 7}},
[2] = {storage = 20116, cplayerpos = {x = 1012, y = 1014, z = 7}},
[3] = {storage = 20117, cplayerpos = {x = 1014, y = 1013, z = 7}}
}
function storagechecker.onStepIn(player, item, position, fromPosition)
if not player or player:isInGhostMode() then
return true
end
for _, storages in ipairs(Storagetable) do
if player:getStorageValue(storages.storage) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "you have got your reward.")
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:teleportTo(fromPosition)
return true
end
end
end
storagechecker:aid(actionId)
storagechecker:register()