broadcast on lvl up

janes123

Well-Known Member
Joined
Jun 21, 2012
Messages
80
Reaction score
1
Hey, im looking for a scritp that will broadcast a msg like name up level 100 for tfs 1.3
 

Printer

if Printer then print("LUA") end
Premium User
Joined
Dec 27, 2009
Messages
5,734
Reaction score
2,005
Location
Sweden?
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
 

Printer

if Printer then print("LUA") end
Premium User
Joined
Dec 27, 2009
Messages
5,734
Reaction score
2,005
Location
Sweden?
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")
 
Top