Dilio
Owner of Project Thala
Decided to remake my script but make it more configurable.
Step 1 -
Go to Creaturescripts
Step 2 -
Open Creaturescripts.xml
Add:
Step 3 -
Go to login.lua
Add:
Step 4 -
Go to creaturescripts and create levelbroadcast.lua
Add:
Basically if you want it to broadcast at level 100, then you set the local old as 100, and the local new as 99 since that's 1 level below it. That way if someone is level 99, and reaches level 101, it will still broadcast, whereas just putting newlevel == 100, it wouldn't work.
Credits:
Me(Script)
Step 1 -
Go to Creaturescripts
Step 2 -
Open Creaturescripts.xml
Add:
Code:
<event type="advance" name="LevelBroadcast" script="levelbroadcast.lua"/>
Step 3 -
Go to login.lua
Add:
Code:
registerCreatureEvent(cid, "LevelBroadcast")
Step 4 -
Go to creaturescripts and create levelbroadcast.lua
Add:
Lua:
local old = 100 --Level you want broadcasted
local new = 99 --1 Level below what you want broadcasted
function onAdvance(cid, skill, oldlevel, newlevel)
local name = getCreatureName(cid)
if skill == SKILL__LEVEL and oldlevel < old and newlevel > new then
doBroadcastMessage("Congratulations " .. name .. " on level " .. old .. "!", MESSAGE_STATUS_CONSOLE_RED)
return TRUE
end
end
Basically if you want it to broadcast at level 100, then you set the local old as 100, and the local new as 99 since that's 1 level below it. That way if someone is level 99, and reaches level 101, it will still broadcast, whereas just putting newlevel == 100, it wouldn't work.
Credits:
Me(Script)