juansanchez
Intermediate OT User
- Joined
- Apr 2, 2015
- Messages
- 217
- Reaction score
- 130
Hi guys, i'm having a problem with a script i'm using.
So you guys understand:
I have an area where i usually spawn monsters for players to kill, like, a lot of monsters. And i didn't want the players to actually die when they die there.
I don't want to use the PVP tool in Rme because then players can kill each other, making it not fun for the low level players.
The script i posted up here partially works. For an unown reason, when the player die, sometimes he doens't die and is teleported to the Local Pos. And sometimes the players dies for real. No errors in console no nothing, and i can't figure out why.
I tought it was maybe because they are dying too fast or something, but it's not that.
Anyone can help me out?
I'm using TFS 0.3.7
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local from, to = {x = 1051, y = 592, z = 7},{x = 1056, y = 596, z = 7}
local pos = {x = 543, y = 525, z = 7}
if isPlayer(cid) and isInRange(getCreaturePosition(cid), from, to) then
doTeleportThing(cid, pos)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
doRemoveConditions(cid, false)
return false
end
return true
end
So you guys understand:
I have an area where i usually spawn monsters for players to kill, like, a lot of monsters. And i didn't want the players to actually die when they die there.
I don't want to use the PVP tool in Rme because then players can kill each other, making it not fun for the low level players.
The script i posted up here partially works. For an unown reason, when the player die, sometimes he doens't die and is teleported to the Local Pos. And sometimes the players dies for real. No errors in console no nothing, and i can't figure out why.
I tought it was maybe because they are dying too fast or something, but it's not that.
Anyone can help me out?
I'm using TFS 0.3.7