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

Need a simple script, 1 min effort!

samesiet

New Member
Joined
Sep 1, 2009
Messages
6
Reaction score
0
Alright so I am learning to code, but I just cant get a hang of how to make onAdvance to check for a specific level @ tfs 0.3.6

Code:
function onAdvance(cid, skill, newLevel)
if(newLevel == 100) then
doSendAnimatedText(getCreaturePosition(cid), "Level 100 text.", math.random(1,255))
end
end

Will that work?

Edit: Dont bother about to check SKILL_EXPERIENCE first, I just wrote it generally :3
 
Last edited:
Code:
local color = math.random(1, 255)
function onAdvance(cid, skill, oldLevel, newLevel)
    if getPlayerLevel(cid) == 100 then
        doSendAnimatedText(getCreaturePosition(cid), "Level 100", color)
    end
end
 
Last edited:
Here is one using addEvent
Code:
local times = 5 -- it should be 5 times max, or it will break the addEvent formula

function color(cid, min, max)
    doSendAnimatedText(getCreaturePosition(cid), "Level 100", math.random(min, max))
end
function onAdvance(cid, skill, oldLevel, newLevel)
    if getPlayerLevel(cid) == 100 then
        for n = 1, times do
            addEvent(color, n * 1000, cid, (n * 25 + times), (n * 50 + times) )
        end
    end
end
 
Last edited:
Back
Top