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

Lua Frag Remove

Esbuma

New Member
Joined
Apr 19, 2017
Messages
21
Reaction score
1
I have these script to when you use a item remove your frags and skull(only work for red and black skull)

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

    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

The problem is, if you are black skull or red skull and use the item, you lose your skull, but if afther that you kill 1 player you go to black/red skull again?

How can i fix that? Because if the script remove the frags you should need to kill 12 player(is how my confg.lua is setup)

These is my config.lua on the kill part
Code:
timeToDecreaseFrags = 4 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75
dayKillsToRedSkull = 8
dayKillsToBlackSkull = 12
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
useBlackSkull = true
redSkullDuration = 30
blackSkullDuration = 45
orangeSkullDuration = 7
 
Last edited:
Very weird, but now you table player_kills is empty true?

Yes true...but that table cant be empty, because is from it that guild wars frags and players frags(to see who has most kill in the server) cames from...so even if the delete part worked...it was not the perfect solution.

In my opnion the dailyfrags counter is still storage in somewhere that i cant figure out where
 
Back
Top