Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 736
- Solutions
- 9
- Reaction score
- 121
Hello guys! im testing new things and i've created simple script, but for some reason I dont know it crashes the server.
Any help would be welcome!
Thanks for your time.
Code:
function onCastSpell(creature, var)
local pos = creature:getPosition()
local item = Game.createItem(2579, 1, pos)
if item then
item:setActionId(8764)
local items = Tile(pos):getItems()
for i = 1, #items do
addEvent(function() items[i]:remove() end, 10000)
end
end
return true
end
Any help would be welcome!
Thanks for your time.