Siegh
Thronar Developer
Hello 
I'm using this script as a trap that takes players inside a specific area, teleports them to a designated location, and causes them some damage.
The teleport part works fine, but I'm not being able to "target" the damaging function to the affected player even though I'm using the same selection criteria as the teleporting function. What am I doing wrong?
Thanks in advance!

I'm using this script as a trap that takes players inside a specific area, teleports them to a designated location, and causes them some damage.
The teleport part works fine, but I'm not being able to "target" the damaging function to the affected player even though I'm using the same selection criteria as the teleporting function. What am I doing wrong?
Thanks in advance!
LUA:
function fall()
local square = {
frompos = {x = 1180, y = 924, z = 12},
topos = {x = 1180, y = 924, z = 12},
exitpos = {x = 1179, y = 918, z = 14}
}
for a = square.frompos.x, square.topos.x do
for b = square.frompos.y, square.topos.y do
dmg = 400
doTargetCombatHealth(0, getTopCreature(pos).uid, COMBAT_FIREDAMAGE, -dmg*0.75, -dmg, 7)
pos = {x = a, y = b, z = 12, stackpos = 255}
doTeleportThing(getTopCreature(pos).uid,square.exitpos)
end
end
end
fall()

