president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Hi folks!
I'm having some problems in a system here, so.. The ideia is a script to when the player stepin a item X is and ground has actionid Y then will teleport the item X to centerPosition, but I don't know why it is not working, can someone help me on that?
Thanks.
I'm having some problems in a system here, so.. The ideia is a script to when the player stepin a item X is and ground has actionid Y then will teleport the item X to centerPosition, but I don't know why it is not working, can someone help me on that?
Code:
local centerPosition = Position(1020, 1031, 7)
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local tile = Tile(position)
if not tile then
return false
end
local newItem = tile:getItemById(2160)
if newItem then
newItem:teleportTo(config.centerPosition)
newItem:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
return true
end
Thanks.