TFS 1.2
Lua Script Error: [Action Interface]
data/actions/scripts/frag_remover.lua:onUse
data/actions/scripts/frag_remover.lua:3: attempt to call field 'contains' (a nil value)
stack traceback:
[C]: in function 'contains'
data/actions/scripts/frag_remover.lua:3: in function <data/actions/scripts/frag_remover.lua:1>
anyy fixes?
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local tile = Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE)
if not tile then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be in protection zone to use this item.")
return true
end
if isInArray({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
that script work well. Cya