• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction [B]Color type "noob"[/B]

natix4

mc
Joined
Nov 8, 2009
Messages
154
Reaction score
1
Location
Poland
Welcome back! Now I'll show you how to make a color word when he writes the word "noob". Let's get started
First open your talkactions/talkactions.xml
And write this code:
Code:
	<talkaction access="0" words="noob" script="noob.lua"/>
Next open your talkactions/scripts and create file noob.lua
and write this code
local colors =
{
TEXTCOLOR_BLUE,
TEXTCOLOR_LIGHTBLUE,
TEXTCOLOR_LIGHTGREEN,
TEXTCOLOR_TEAL,
TEXTCOLOR_PURPLE,
TEXTCOLOR_PLATINUMBLUE,
TEXTCOLOR_LIGHTGREY,
TEXTCOLOR_DARKRED,
TEXTCOLOR_RED,
TEXTCOLOR_ORANGE,
TEXTCOLOR_YELLOW,
TEXTCOLOR_WHITE_EXP
}
function onSay(cid, words, param)
local playerpos = getPlayerPosition(cid)
local random = math.random(1, #colors)

if math.max(math.abs(playerpos.x-23), math.abs(playerpos.y-30)) < 9999 then
doSendAnimatedText(playerpos, "NOOB!", colors[random])
return 0
end
return 1
end
Screen:
12363050.jpg

Congratulations! You did it. Say word "noob" on your ots.
Tested with TFS 0.3.5 . Dont forget to rep++ me!
Greetings natix4!
 
Last edited:
shortest, and multicolor

Lua:
<talkaction words="!NOOB" event="buffer" value="doSendAnimatedText(getCreaturePosition(cid), "NOOB!", math.random(1,255)"/>

saved 24 unnecesary lines :peace:
 
shortest, and multicolor

Lua:
<talkaction words="!NOOB" event="buffer" value="doSendAnimatedText(getCreaturePosition(cid), "NOOB!", math.random(1,255)"/>

saved 24 unnecesary lines :peace:

Won't work :peace:
 
First reason: missing ')'.
Second reason: It should be:
Code:
<talkaction words="!NOOB" event="buffer" value="doSendAnimatedText(getCreaturePosition(cid), 'NOOB!', math.random(1,255))"/>

' not " :p
 
shortest, and multicolor

Lua:
<talkaction words="!NOOB" event="buffer" value="doSendAnimatedText(getCreaturePosition(cid), "NOOB!", math.random(1,255)"/>

saved 24 unnecesary lines :peace:

Lua:
<talkaction words="NOOB;NEWB;NUB" event="buffer" value="doSendAnimatedText(getCreaturePosition(cid), words, math.random(1,255)"/>

multi words :D
 
Back
Top