I'm trying to create a spells for a monster that can send some players from the screen to another location
my code below is closing the server
my code below is closing the server
function onCastSpell(creature, var)
local spectators = Game.getSpectators(Position(33711, 31470, 14), false, false, 14, 14, 14, 14)
for i = 1, #spectators do
local spec = spectators
if spec:isPlayer() then
spec:teleportTo(Position(33780, 31470, 14))
spec:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
end
return true
end