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

Black Skull Remove

Dorianek

Member
Joined
Nov 29, 2018
Messages
252
Reaction score
10
Location
Poland
TFS 1.3

37453

Skull.lua

C++:
-- Scripted by Leon Zawodowiec --
function onUse(cid, item, frompos, item2, topos)
    local playerskull = getCreatureSkullType(cid)
    local skulls = {
                    SKULL_NONE,
                    SKULL_YELLOW,
                    SKULL_GREEN,
                    SKULL_WHITE
                    }
 
    if isInArray(skulls, playerskull) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove that skull !")
        return 0
    else
        doCreatureSetSkullType(cid, skulls[1])
        doRemoveItem(item.uid, 1)
        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your Skull has been removed !")
    end
return true
end
 
Try with this

LUA:
-- Scripted by Leon Zawodowiec --
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerskull = player:getSkull()
    local skulls = {
                    SKULL_NONE,
                    SKULL_YELLOW,
                    SKULL_GREEN,
                    SKULL_WHITE
                    }

    if isInArray(skulls, playerskull) then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove that skull !")
        return 0
    else
        player:setSkull(skulls[1])
        item:remove(1)
        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. player:getGuid() .. ")")
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your Skull has been removed !")
    end
return true
end
 
Back
Top