T
Tibia Demon
Guest
i try to fix this script to add storage to player when he step any tile in fromposition toposition area but i cant make the table and i need to check if player has obtained the storage then dont do anything.
i need to make it in like 10 fromposition toposition ranges but i am bad with tables. no need to make 10 script.
or i should add actionid to all tiles fromposition toposition?
i need to make it in like 10 fromposition toposition ranges but i am bad with tables. no need to make 10 script.
Lua:
local QuestStorage = MoveEvent()
QuestStorage:type("stepin")
local config = {
['queststorageone'] = {
fromPositionArea = Position(994, 992, 7), -- fromPosition
toPositionArea = Position(998, 997, 7), -- toPosition
Mystorage = 'PlayerStorageKeys.queststorageone'
},
['queststoragetwo'] = {
fromPositionArea = Position(1006, 992, 7), -- fromPosition
toPositionArea = Position(1009, 997, 7), -- toPosition
Mystorage = 'PlayerStorageKeys.queststoragetwo'
},
}
function QuestStorage.onStepIn(player, item, position, fromPosition)
if not player or player:isInGhostMode() then
return true
end
if player:getPosition():isInRange(config.fromPositionArea, config.toPositionArea) then
player:setStorageValue(config.Mystorage, 1)
end
return true
end
QuestStorage:register()
Last edited by a moderator: