• 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 (TFS 1.3) receive a message when leveling up

antonio664

Member
Joined
Jan 9, 2013
Messages
129
Reaction score
5
When the player goes up to level 10, receive a message on the screen

and also



When the player moves up Sword 10 Club, receive a message on the screen
When the player moves up Sword 10 Sword, receive a message on the screen
When the player moves up Sword 10 Distance, receive a message on the screen
When the player moves up Sword 10 ML, receive a message on the screen




TFS 1.3

I'll be thankful
 
Solution
You can add something like this to login.lua and change storage values or skill ids/message to suit your needs.
Lua:
if player:getLevel() == 10 and not player:getStorageValue(37113) then
player:sendTextMessage(MESSAGE_INFO_DESCR, "yourmessagehere!")
player:setStorageValue(37113, 1)
end
Lua:
local skills_id = {1, 2, 3, 4, 5, 6}
if player:getSkillLevel(skills_id[i]) == 10 and not player:getStorageValue(37112) then
player:sendTextMessage(MESSAGE_INFO_DESCR, "yourmessagehere!")
player:setStorageValue(37112, 1)
end
C++:
    SKILL_FIST = 0,
    SKILL_CLUB = 1,
    SKILL_SWORD = 2,
    SKILL_AXE = 3,
    SKILL_DISTANCE = 4,
    SKILL_SHIELD = 5,
    SKILL_FISHING = 6,
    SKILL_MAGLEVEL = 7,
    SKILL_LEVEL = 8,
You can add something like this to login.lua and change storage values or skill ids/message to suit your needs.
Lua:
if player:getLevel() == 10 and not player:getStorageValue(37113) then
player:sendTextMessage(MESSAGE_INFO_DESCR, "yourmessagehere!")
player:setStorageValue(37113, 1)
end
Lua:
local skills_id = {1, 2, 3, 4, 5, 6}
if player:getSkillLevel(skills_id[i]) == 10 and not player:getStorageValue(37112) then
player:sendTextMessage(MESSAGE_INFO_DESCR, "yourmessagehere!")
player:setStorageValue(37112, 1)
end
C++:
    SKILL_FIST = 0,
    SKILL_CLUB = 1,
    SKILL_SWORD = 2,
    SKILL_AXE = 3,
    SKILL_DISTANCE = 4,
    SKILL_SHIELD = 5,
    SKILL_FISHING = 6,
    SKILL_MAGLEVEL = 7,
    SKILL_LEVEL = 8,
 
Last edited:
Solution
Back
Top