danne3131
Well-Known Member
- Joined
- Jun 26, 2008
- Messages
- 391
- Solutions
- 1
- Reaction score
- 50
So basicly i want to remove this Check Storage value, but ive tried alot of different things since im not a Lua Expert i either change it so it doesnt work at all or it just says Not activated.. Please help me scripters of otland! 
What should i edit/Delete in order to just make it work as an teleport? =)
Code:
local config = {
[12380] = {storageKey = Storage.WrathoftheEmperor.Questline, toPosition = {Position(33138, 31248, 6), Position(33211, 31065, 9)}},
[12381] = {storageKey = Storage.WrathoftheEmperor.Questline, toPosition = {Position(33211, 31065, 9), Position(33138, 31248, 6)}}
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local targetTile = config[item.actionid]
if not targetTile then
return true
end
local hasStorageValue = player:getStorageValue(targetTile.storageKey) >= 5
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:teleportTo(targetTile.toPosition[hasStorageValue and 1 or 2])
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
if not hasStorageValue then
player:say('This portal is not activated', TALKTYPE_MONSTER_SAY)
end
return true
end
What should i edit/Delete in order to just make it work as an teleport? =)