• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

help here pls

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
Hi,

In my server have points system,points get killing players,is PvP-e.

I wanna players with x points get x skull.

Here function:

Code:
function getPlayerPoints(cid)

Example:


PHP:
SKULL_YELLOW = 100 points
SKULL_GREEN = 300 points
SKULL_WHITE = 700 points
SKULL_RED = 1200 points
SKULL_BLACK = 2000 points
 
Not sure what you wanted, but here's a really noobish script, since I couldnt be arsed to make a good one :p
LUA:
function onKill(cid, target)
	if isPlayer(target) then
	local points = getPlayerPoints(cid)
		if (points >= 100 and points <= 299) then
			doCreatureSetSkullType(cid, 1)
		elseif (points >= 300 and points <= 699) then
			doCreatureSetSkullType(cid, 2)
		elseif (points >= 700 and points <= 1199) then
			doCreatureSetSkullType(cid, 3)
		elseif (points >= 1200 and points <= 1999) then
			doCreatureSetSkullType(cid, 4)
		elseif points >= 2000 then
			doCreatureSetSkullType(cid, 5)
		else
		return true
		end
	else
	return true
	end
return true
end
 
^ Simply an onThink is easier. (Globalevent)

Try it, interval like 30 sec or something, I guess..

LUA:
function onThink(interval, lastExecution, thinkInterval)
	for _, cid in ipairs(getPlayersOnline()) do
		local points = getPlayerPoints(cid)
                if (points >= 100 and points <= 299) then
                        doCreatureSetSkullType(cid, 1)
                elseif (points >= 300 and points <= 699) then
                        doCreatureSetSkullType(cid, 2)
                elseif (points >= 700 and points <= 1199) then
                        doCreatureSetSkullType(cid, 3)
                elseif (points >= 1200 and points <= 1999) then
                        doCreatureSetSkullType(cid, 4)
                elseif points >= 2000 then
                        doCreatureSetSkullType(cid, 5)
                else
                return true
                end
	end
	return true
end
 
do this in creature script

LUA:
function onThink(interval, lastExecution, thinkInterval)
        for _, cid in ipairs(getPlayersOnline()) do
                local points = getPlayerPoints(cid)
                if (points >= 100 and points <= 299) then
				    if getPlayerSkullType(cid) ~= 1 then
                        doCreatureSetSkullType(cid, 1)
				    end
                elseif (points >= 300 and points <= 699) then
				    if getPlayerSkullType(cid) ~= 2 then
                        doCreatureSetSkullType(cid, 2)
					end
                elseif (points >= 700 and points <= 1199) then
				    if getPlayerSkullType(cid) ~= 3 then
                        doCreatureSetSkullType(cid, 3)
					end
                elseif (points >= 1200 and points <= 1999) then
				     if getPlayerSkullType(cid) ~= 4 then  
                        doCreatureSetSkullType(cid, 4)
					end
                elseif points >= 2000 then
				    if getPlayerSkullType(cid) ~= 5 then
                        doCreatureSetSkullType(cid, 5)
					end
                end
        end
        return true
end

Code:
<event type="think" name="point" event="script" value="xxxx.lua"/>
login.lua
Code:
registerCreatureEvent(cid, "point")
 
Back
Top