president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Hi everyone, I got stucked with the code below it is suppost to check the tile id. I'll explain it.. If you are under a tile with id 999 and you're in proctetion zone then you can use the item if not returns a error msg.
Thanks.
Code:
function onUse(player, item, fromPosition, position, target, toPosition, isHotkey)
local tile = Tile(position)
if not tile then
return false
end
local tile = tile:getItemById(9999)
if tile and Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
-- shit happens
else
player:sendCancelMessage("You can't do it without be in a protection zones.")
end
return true
end
Thanks.