MaR0
Banned User
- Joined
- Apr 16, 2018
- Messages
- 272
- Solutions
- 3
- Reaction score
- 29
i'm using this script to check the skulls if you login but when i kill someone i didn't get frags but I discovered the problem was from this script
what should i do the script is working fine but i can't get frags if killed someone nothing happen the normal message "Warning! The murder of Player was not justified." not coming
Lua:
function checkSkull(cid)
-- Default skull is green
local skull = SKULL_WHITE
-- Get the frag count
local frags = getPlayerStorageValue(cid, 4321)
if frags >= 2 and frags < 10 then
-- 2 frags or more, below 10
skull = SKULL_GREEN
elseif frags >= 10 and frags < 18 then
-- 10 frags or more, below 18
skull = SKULL_RED
elseif frags >= 18 then
-- 18 frags or more
skull = SKULL_BLACK
end
-- Set the pre-determined skull
doCreatureSetSkullType(cid, skull)
return true
end
function onKill(cid, target)
return checkSkull(cid)
end
function onLogin(cid)
return checkSkull(cid)
end
XML:
<event type="kill" name="skulls" event="script" value="skulls.lua"/>
<event type="login" name="skulls_check" event="script" value="skulls.lua"/>
XML:
registerCreatureEvent(cid, "skulls")
registerCreatureEvent(cid, "skulls_check")
if getPlayerStorageValue(cid, 4321) < 1 then
setPlayerStorageValue(cid, 4321, 0)
end