Cosmotonio
New Member
- Joined
- Nov 26, 2007
- Messages
- 142
- Reaction score
- 0
I make this scrip, but is not inished yet.
If you kill a player with summon the server will crash.
If the hit is bigger than your life you are dead or the server will crash.
creaturescripts.xml
arena.lua
Please help me to fix
If you kill a player with summon the server will crash.
If the hit is bigger than your life you are dead or the server will crash.
creaturescripts.xml
Code:
<event type="preparedeath" name="Arena" script="Arena.lua" />
arena.lua
Code:
local arenapos = {fromx=120, fromy=32, tox=129, toy=39, z=9}
local exit = {x=125, y=30, z=9}
function onPrepareDeath(cid, killer)
for i = arenapos.fromx, arenapos.tox do
for j = arenapos.fromy, arenapos.toy do
local pos = {x=i, y=j, z=arenapos.z, stackpos=253}
local getThing = getThingfromPos(pos).uid
if isPlayer(getThing) == 1 then
doTeleportThing(cid, exit, TRUE)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
end
end
end
return FALSE
end
Please help me to fix
Last edited: