• 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!

Lua Skull System

Saint Spear

Veteran OT User
Joined
Jun 22, 2016
Messages
1,547
Solutions
18
Reaction score
379
Hi Otlanders
i'm searching for script for Skull System..
like im making 8.60 war server
so i want like
20 frags - Green Skull
50 frags - White Skull
100 frags - Red Skull
500 frags - Black Skull
Thanks
 
Use Skullsystem.xml and put it in mods

XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes">
<config name="SkullC_func"><![CDATA[

function setSkullColor(cid)
   if not isPlayer(cid) then
       return
   end

   local t = {
       [{15,29}] = SKULL_WHITE,
       [{30,49}] = SKULL_YELLOW,
       [{50,89}] = SKULL_WHITE,
       [{90,149}] = SKULL_RED,
       [{150,math.huge}] = SKULL_BLACK
   }
   local frags = getPlayerFrags(getPlayerGUID(cid))
   for var, ret in pairs(t) do
       if frags >= var[1] and frags <= var[2] then
           doCreatureSetSkullType(cid, ret)
       end
   end
end

function getPlayerFrags(guid)
    local result = db.getResult("SELECT COUNT(*) as count FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. guid)
    if(result:getID() ~= -1) then
       local count = result:getDataInt("count")
        result:free()
       return count
    end
end 
]]></config>
<event type="login" name="SkullLogin" event="script"><![CDATA[
domodlib('SkullC_func')
function onLogin(cid)
   registerCreatureEvent(cid, "ColorKill")
   setSkullColor(cid)
   return true
end]]></event>
<event type="kill" name="ColorKill" event="script"><![CDATA[
domodlib('SkullC_func')
function onKill(cid, target)
   if isPlayer(cid) and isPlayer(target) then
       doCreatureSetSkullType(target, 0)
       addEvent(setSkullColor, 100, cid)
   end
   return true
end]]></event>
</mod>
 
Last edited by a moderator:
Use Skullsystem.xml and put it in mods

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes">
<config name="SkullC_func"><![CDATA[

function setSkullColor(cid)
   if not isPlayer(cid) then
       return
   end

   local t = {
       [{15,29}] = SKULL_WHITE,
       [{30,49}] = SKULL_YELLOW,
       [{50,89}] = SKULL_WHITE,
       [{90,149}] = SKULL_RED,
       [{150,math.huge}] = SKULL_BLACK
   }
   local frags = getPlayerFrags(getPlayerGUID(cid))
   for var, ret in pairs(t) do
       if frags >= var[1] and frags <= var[2] then
           doCreatureSetSkullType(cid, ret)
       end
   end
end

function getPlayerFrags(guid)
    local result = db.getResult("SELECT COUNT(*) as count FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. guid)
    if(result:getID() ~= -1) then
       local count = result:getDataInt("count")
        result:free()
       return count
    end
end 
]]></config>
<event type="login" name="SkullLogin" event="script"><![CDATA[
domodlib('SkullC_func')
function onLogin(cid)
   registerCreatureEvent(cid, "ColorKill")
   setSkullColor(cid)
   return true
end]]></event>
<event type="kill" name="ColorKill" event="script"><![CDATA[
domodlib('SkullC_func')
function onKill(cid, target)
   if isPlayer(cid) and isPlayer(target) then
       doCreatureSetSkullType(target, 0)
       addEvent(setSkullColor, 100, cid)
   end
   return true
end]]></event>
</mod>
Okey, thanks i added that but.. now i get next bug when i kill someone i dont get frag :(
 
thats impossible maybe you have error in compile can check it and post it here! then we can help you
your scripts is a mod right? , men you have an script for if the player die ( with skull green, yellow red or whatever) log in or appear in temple unskulled?
im just missing this script
 
your scripts is a mod right? , men you have an script for if the player die ( with skull green, yellow red or whatever) log in or appear in temple unskulled?
im just missing this script
put its in mods/skullsystem.xml
and try ye but you have make in database loss_containers = 0
cuz if you get skull you will lose the items if you dont you in database/players strucature/loss_containers = 0
 
put its in mods/skullsystem.xml
and try ye but you have make in database loss_containers = 0
cuz if you get skull you will lose the items if you dont you in database/players strucature/loss_containers = 0
Its not for 0.3.6 tfs .. and also i have script for not losing items :D
 
put its in moods/skullsystem.xml
and try ye but you have make in database loss_containers = 0
cuz if you get skull you will lose the items if you dont you in database/players strucature/loss_containers = 0
i have all my surces compiled. that not the problem i need the player keep skull when log out and lost it just when die
 
Back
Top