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

I want all the colors

Aako

New Member
Joined
May 5, 2011
Messages
32
Reaction score
1
hey guys i got this script, it says when somebody has logged in, it says welcome with red color
how do I put a random colors, like red, blue, white, green, yellow, etc

PHP:
function onLogin (cid)
playerpos = getPlayerPosition(cid)
doSendAnimatedText(playerpos, "Welcome!", TEXTCOLOR_RED)
doSendMagicEffect(playerpos, 36)
return TRUE
end
 
math.random(1, 255) I guess
but I'm not sure how many colours are handled by tibia client

also
why you use global playerpos?
and, you dont even need to create that variable, just do
Code:
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", math.random(1, 255))
doSendMagicEffect(getPlayerPosition(cid), 36)
(but if you want to use it more times than 1-2 then declare variable, getting some data every time is bad idea)
 
Back
Top