Hi everyone, I need to help to fix this script:
When a PK or RS or NO-SKULL player is killed, a storage value is modified, I need it for a system I'm gonna develop. I shall rep+ and also include in the sys's credits.
The bug is that the storage isn't modified when the player is killed. I dont know if I have to make a registercreature. I use tfs 0.2.2. Here it is:
When a PK or RS or NO-SKULL player is killed, a storage value is modified, I need it for a system I'm gonna develop. I shall rep+ and also include in the sys's credits.
The bug is that the storage isn't modified when the player is killed. I dont know if I have to make a registercreature. I use tfs 0.2.2. Here it is:
Lua:
function onKill(cid, target)
if isPlayer(target) == TRUE then
local victim = getCreatureName(target)
local playerpos = getPlayerPosition(cid)
local exp = getPlayerStorageValue(cid, 2010)
if getPlayerSkullType(victim) == 3 then
doSendAnimatedText(playerpos, "+REP", TEXTCOLOR_LIGHTBLUE)
setPlayerStorageValue(cid, 2010, (exp+15))
elseif getPlayerSkullType(victim) == 4 then
doSendAnimatedText(playerpos, "+REP", TEXTCOLOR_LIGHTBLUE)
setPlayerStorageValue(cid, 2010, (exp+30))
elseif getPlayerSkullType(victim) == 0 then
doSendAnimatedText(playerpos, "-REP", TEXTCOLOR_RED)
setPlayerStorageValue(cid, 2010, (exp-30))
end
end
return TRUE
end