• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

skulls for frags

Triggah

TrigCore
Joined
Aug 1, 2007
Messages
436
Reaction score
2
possible to make a script that gives diff color skulls for diff amount of frags (pvp-e server):

example:
when player has:
10 kills - white skull
25 kills - yellow skull
50 kills - red skull
100 kills - black skull
 
hello trigah
Try to use this code (by me) :)

in data/creaturescripts/scripts add a new file named deathSkulls.lua and place this inside:
PHP:
local fragStorage = 1234 -- storage id for killer players (storage if para o jogador matador)
local skulls = { -- skulls ids
	[1]={frags = 10}, -- id 1 for yellow skull
	[2]={frags = 25}, -- id 2 for green skull
	[3]={frags = 50}, -- id 3 for white skull
	[4]={frags = 100} -- id 4 for red skull
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if isPlayer(mostDamageKiller) == true then
		setPlayerStorageValue(mostDamageKiller, fragStorage, getPlayerStorageValue(mostDamageKiller, fragStorage)+1)
		for i = 1, table.maxn(skulls) do
			if getPlayerStorageValue(mostDamageKiller, fragStorage) >= skulls[i].frags then
				doCreatureSetSkullType(mostDamageKiller, skulls[i])
			end
		end
	end
	return true
end

in data/creaturescripts/creaturescripts.xml add this line:
PHP:
<event type="death" name="addSkullForFrags" event="script" value="deathSkulls.lua"/>

and in data/creaturescripts/scripts/login.lua, add this event:
PHP:
registerCreatureEvent(cid, "addSkullForFrags")

like this: (example)
PHP:
function onLogin(cid)
	registerCreatureEvent(cid, "addSkullForFrags")
	return true
end

ok? :)
(not tested)
Bye good luck
 
Last edited:
Sort table from highest to lowest value, why? Cause after frag, and if you have 100+ frags your skull will blink :p
 
Back
Top