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

[Avesta] Remove Redskull Script

Veterana

Oldschool Player
Joined
May 4, 2010
Messages
194
Reaction score
7
Need a script for Avesta that make a item remove all frags from a player when used.

Item ID should be: 5541

Anyone got the skills to make this? Please help! I will REP++
 
Lua:
<action itemid="5541" event="script" value="xxxx.lua"/>

and in actions/scripts
Lua:
local config =
{
    item = 5541, 
    level = 1,
    count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags have been removed.")
        doRemoveItem(item.uid)
        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
    else
        doPlayerSendCancel(cid, "You dot have enough level")
    end
    return TRUE
end
 
Lua:
<action itemid="5541" event="script" value="xxxx.lua"/>

and in actions/scripts
Lua:
local config =
{
    item = 5541, 
    level = 1,
    count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags have been removed.")
        doRemoveItem(item.uid)
        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
    else
        doPlayerSendCancel(cid, "You dot have enough level")
    end
    return TRUE
end

It tells you "Your frags have been removed." but the frags doesnt get removed.


The message i get in console is:

Lua Script Error: [Action Interface]
data/actions/scripts/scroll_frag_remover.lua:eek:nUse


data/actions/scripts/scroll_frag_remover.lua:11: attempt to index global 'db' <a nil value>
stack traceback:
data/actions/scripts/scroll_frag_remover.lua:11: in function <data/data/actions/scripts/scroll_frag_remover.lua:7>
 
Last edited:
Back
Top