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

broadcast on lvl up

janes123

New Member
Joined
Jun 21, 2012
Messages
100
Reaction score
4
Hey, im looking for a scritp that will broadcast a msg like name up level 100 for tfs 1.3
 
Solution
Lua:
local levels = {50, 100, 200}

function onAdvance(player, skill, oldLevel, newLevel)
    if skill ~= SKILL_LEVEL or newLevel <= oldLevel then
        return true
    end

    if isInArray(levels, newLevel) then
        broadcastMessage(("%s has reached level %d."):format(player:getName(), newLevel), MESSAGE_STATUS_WARNING)
    end

    return true
end
Lua:
local levels = {50, 100, 200}

function onAdvance(player, skill, oldLevel, newLevel)
    if skill ~= SKILL_LEVEL or newLevel <= oldLevel then
        return true
    end

    if isInArray(levels, newLevel) then
        broadcastMessage(("%s has reached level %d."):format(player:getName(), newLevel), MESSAGE_STATUS_WARNING)
    end

    return true
end
 
Solution
In creaturescripts:

You add this line in creaturescripts.xml
XML:
<event type="advance" name="PlayerAdvance" script="playeradvance.lua" />

Then in your login.lua
Lua:
player:registerEvent("PlayerAdvance")
 
Back
Top