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

Looking for a Frag Remover Script

Valania

Learning PHP/Lua
Joined
Oct 23, 2009
Messages
315
Reaction score
1
Location
Germany
TFS 1.3 - Server running on 8.6. I"ve been searching for one but the struggle is that it does not delete the frags, only the skull is removed
 
Last edited:
Solution
Try this one
actions.xml
XML:
<action itemid="XXXX" script="frag_remover.lua"/>
actions/scripts
frag_remover.lua

Lua:
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        player:setSkull(SKULL_NONE)
        player:setSkullTime(0)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!")
        db.query("UPDATE player_deaths SET unjustified = 0 WHERE unjustified = 1 AND killed_by = " .. db.escapeString(player:getName()))
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or...
Try this one
actions.xml
XML:
<action itemid="XXXX" script="frag_remover.lua"/>
actions/scripts
frag_remover.lua

Lua:
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        player:setSkull(SKULL_NONE)
        player:setSkullTime(0)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!")
        db.query("UPDATE player_deaths SET unjustified = 0 WHERE unjustified = 1 AND killed_by = " .. db.escapeString(player:getName()))
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or black skulls!")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end

    return true
end
 
Last edited:
Solution
Try this one
actions.xml
XML:
<action itemid="XXXX" script="frag_remover.lua"/>
actions/scripts
frag_remover.lua

Lua:
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        player:setSkull(SKULL_NONE)
        player:setSkullTime(0)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!")
        db.query("UPDATE player_deaths SET unjustified = 0 WHERE unjustified = 1 AND killed_by = " .. db.escapeString(player:getName()))
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or black skulls!")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end

    return true
end
Is it possible to add a condition where the frag remover is only usable if the player is not PZ-locked?
 
Back
Top