• 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 Server message when someone takes level 50, 100, 150, 200 etc...

henkebenk

New Member
Joined
Feb 25, 2024
Messages
8
Reaction score
1
I'd like a script that shows the whole server when someone takes level 50, 100, 150, 200 etc...

"PlayerX advanced to level 150. Give them a congratz!" or something similar...

It's for TFS 1.4.2

Thank you in advance!
 
LUA:
function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_LEVEL and oldLevel < newLevel then
        local message = string.format("%s has advanced to level %d!", player:getName(), newLevel)
        Game.broadcastMessage(message, MESSAGE_STATUS_CONSOLE_YELLOW)
    end
    return true
end

XML:
    <event type="advance" name="levelup" script="levelup.lua" />
start there. use chat gpt to do the rest for you. I am no longer wasting credit on this stuff.
 
LUA:
function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_LEVEL and oldLevel < newLevel then
        local message = string.format("%s has advanced to level %d!", player:getName(), newLevel)
        Game.broadcastMessage(message, MESSAGE_STATUS_CONSOLE_YELLOW)
    end
    return true
end

XML:
    <event type="advance" name="levelup" script="levelup.lua" />
start there. use chat gpt to do the rest for you. I am no longer wasting credit on this stuff.
can this be rewriten for revscripts please ?
 
can this be rewriten for revscripts please ?

Im suprised you still dont know how to rewrite to revscript :D
You just need to add two extra lines and edit one line :D

LUA:
-- local creatureevent = CreatureEvent("eventName")

function onAdvance(player, skill, oldLevel, newLevel)
-- function creatureevent.onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_LEVEL and oldLevel < newLevel then
        local message = string.format("%s has advanced to level %d!", player:getName(), newLevel)
        Game.broadcastMessage(message, MESSAGE_STATUS_CONSOLE_YELLOW)
    end
    return true
end

-- creatureevent:register()

Its the same for action, movements and what ever else exists :D
If something doesnt work, message me :D
 
Last edited:
Im suprised you still dont know how to rewrite to revscript :D
You just need to add two extra lines and edit one line :D

LUA:
-- local creatureevent = CreatureEvent("eventName")

function onAdvance(player, skill, oldLevel, newLevel)
-- function creatureevent.onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_LEVEL and oldLevel < newLevel then
        local message = string.format("%s has advanced to level %d!", player:getName(), newLevel)
        Game.broadcastMessage(message, MESSAGE_STATUS_CONSOLE_YELLOW)
    end
    return true
end

-- creatureevent:register()

Its the same for action, movements and what ever else exists :D
If something doesnt work, message me :D
like 100 time in otland and outside i tell people that im total blind fuck in codes... and + i dont even like it, more like hate it cuz it messes my head and messes my real work head.... thats why i barely touch scripts, more mapping and content making..

Thanks tho :)
 
@Lbtg There’s already a tutorial on how to convert a regular script into a revscript. It’s really simple and easy. No secrets. Just take a look, and you’ll understand it in 1 to 2 minutes. 😁😎
 
Back
Top