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

1.2 skull system

Webo

Otland 4ever
Joined
Oct 20, 2013
Messages
621
Solutions
10
Reaction score
229
Location
Warsaw
hello im have this script:
Why no work? no erros in console
meybe here error "local frags = player:getStorageValue(27862)"

function onLogin(player)
local frags = player:getStorageValue(27862)
if frags >= 2 and frags < 3 then
player:setSkull(SKULL_YELLOW)
elseif frags >= 4 and frags < 5 then
player:setSkull(SKULL_GREEN)
elseif frags >= 6 and frags < 7 then
player:setSkull(SKULL_WHITE)
elseif frags >= 8 and frags < 9 then
player:setSkull(SKULL_RED)
elseif frags > 10 then
player:setSkull(SKULL_BLACK)
end
return true
end
 
You have to register it as onKill function, so the player gets the skull when reach a certain amount of frags. This script adds you the skull when log in, not in real time.
 
Code:
local fragTable = {
    {fragAmount = {2, 3}, skull = SKULL_YELLOW},
    {fragAmount = {4, 5}, skull = SKULL_GREEN},
    {fragAmount = {6, 7}, skull = SKULL_WHITE},
    {fragAmount = {8, 9}, skull = SKULL_RED},
    {fragAmount = {10, 1000}, skull = SKULL_BLACK}
}

function onLogin(player)
    local storage = player:getStorageValue(27862)
    for i = 1, #fragTable do
        if storage >= fragTable[i].fragAmount[1] and storage <= fragTable[i].fragAmount[2] then
            player:setSkull(fragTable[i].skull)
            break
        end
    end
   
    return true
end
 
Back
Top