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

script to give exact experience GM

EDIT: This is for TFS 1.x, not 0.4
Didn't read that bit, sorry!​

Untested.
Usage: /<talkaction_name>,<player_name>,<exp_amount>

add_exp.lua
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    local split = param:split(",")
    if split[2] == nil then
        player:sendCancelMessage("Insufficient parameters.")
        return false
    end

    local target = Player(split[1])
    if target == nil then
        player:sendCancelMessage("A player with that name is not online.")
        return false
    end

    local expgain = tonumber(split[2])
    if expgain >= 1 then
        target:addExperience(expgain)
    else
        player:sendCancelMessage("You have specified an invalid experience amount.")
    end
    return false
end

skills already exist:
https://github.com/otland/forgottenserver/blob/master/data/talkactions/scripts/add_skill.lua

I don't feel like splicing the two together...
 
Last edited:
Back
Top