ausirosiris
New Member
- Joined
- May 23, 2020
- Messages
- 57
- Reaction score
- 2
Guys, i have this script. It is working fine but, why on earth the last hit 'follows and flies' the player that has been killed?
Lua:
----- Local Towns -----
local arenas = {
[1] = {arena = "xxx", redT = {x = 1034, y = 1077, z = 6}, blueT = {x = 1102, y = 1036, z = 6}},
[2] = {arena = "xxx", redT = {x = 1034, y = 1077, z = 6}, blueT = {x = 1102, y = 1036, z = 6}},
[3] = {arena = "xxx", redT = {x = 1034, y = 1077, z = 6}, blueT = {x = 1102, y = 1036, z = 6}},
[4] = {arena = "xxx", redT = {x = 1034, y = 1077, z = 6}, blueT = {x = 1102, y = 1036, z = 6}}
}
----- Team_Scores-----
local blueTeam, redTeam = 101, 102
----- Killing Section -----
function onStatsChange(cid, attacker, type, combat, value)
local expGain = (getPlayerLevel(cid) + 70) * 0.01 * 70 * (getPlayerLevel(cid) * getPlayerLevel(cid)) - (5 * getPlayerLevel(cid) + 8)
if type == 1 then
if getCreatureHealth(cid) <= value then
if isPlayer(cid) and isPlayer(attacker) then
doPlayerAddExperience(attacker, expGain)
doSendAnimatedText(getPlayerPosition(attacker), expGain, TEXTCOLOR_RED)
doSendMagicEffect(getPlayerPosition(cid), 7)
-----Teleport Temple -----
local map = arenas[getGlobalStorageValue(100)]
if map then
if getPlayerStorageValue(cid, 1002) == 1 then
doTeleportThing(cid, map.blueT)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doRemoveConditions(cid)
doPlayerFeed(cid, 10000)
elseif getPlayerStorageValue(cid, 1003) == 1 then
doTeleportThing(cid, map.redT)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doRemoveConditions(cid)
doPlayerFeed(cid, 10000)
if getCreatureHealth(cid) ~= value then
doPlayerSendCancel(attacker, "Sorry, not possible.")
return false
end
end
------ Finish -----
end
end
end
end
return TRUE
end