Hi
Im trying to use the pvparena script made by talaturen for FS
first, here's the script:
Well, in the begginning i got some errors in the line 17:
here is the error:
So I removed this line and the break thing, also the end from the line, and when the player died, the server crashed, so I made a test, removed the "doCreatureAddHealth(cid, getCreatureMaxHealth(cid))" and It worked, but obviously, he died but the corpse got teleported, then i changed "doCreatureAddHealth(cid, getCreatureMaxHealth(cid))" to "doCreatureAddHealth(cid, 1000)" and now it's worked, but if a monster too strong kill a player especialy if the player is a low lvl, the server still crash, so now I don't know how to fix the things.
Im trying to use the pvparena script made by talaturen for FS
first, here's the script:
Code:
local pvpArena =
{
{
fromPosition = {x=172, y=33, z=8},
toPosition = {x=183, y=41, z=8},
positionToTeleportToOnDeath = {x=178, y=45, z=8}
},
{
fromPosition = {x=121, y=33, z=9},
toPosition = {x=128, y=37, z=9},
positionToTeleportToOnDeath = {x=125, y=31, z=9}
}
}
function onPrepareDeath(cid, killer)
for i = 0, table.maxn(pvpArena) do
if isInPosition(getCreaturePosition(cid), pvpArena[i].fromPosition, pvpArena[i].toPosition) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doTeleportThing(cid, pvpArena[i].positionToTeleportToOnDeath, TRUE)
break
end
end
end
Well, in the begginning i got some errors in the line 17:
Code:
for i = 0, table.maxn(pvpArena) do
Code:
CreatureScript Interface]
data/creaturescripts/scripts/ffa-pvparena.lua:onPrepareDeath
data/creaturescripts/scripts/ffa-pvparena.lua:17: attempt to index field '?' (a nil value)
So I removed this line and the break thing, also the end from the line, and when the player died, the server crashed, so I made a test, removed the "doCreatureAddHealth(cid, getCreatureMaxHealth(cid))" and It worked, but obviously, he died but the corpse got teleported, then i changed "doCreatureAddHealth(cid, getCreatureMaxHealth(cid))" to "doCreatureAddHealth(cid, 1000)" and now it's worked, but if a monster too strong kill a player especialy if the player is a low lvl, the server still crash, so now I don't know how to fix the things.