Forum

> > CS2D > Scripts > Random chat colors?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Random chat colors?

9 replies
To the start Previous 1 Next To the start

old Random chat colors?

strelok_953
User Off Offline

Quote
Hello us
I want make one script...but im n**b with msg2,msg,hudtxt etc.
Please.i need script like this:
1
2
3
4
5
6
7
8
9
rainbow = {33333}

addhook("say","talk")
function talk(id)
for _, in ipairs(rainbow) do
   if player(id,"usgn")=usgn then
msg(id," \rainbow «FunnyMan» <- here rainbow-i dont know how made it ")
end
end
please,help me with this.
Thanks you so much!
And sorry for my English.

Sorry me please! i mean Random (my English)
edited 1×, last 21.08.13 04:36:38 pm

old Re: Random chat colors?

strelok_953
User Off Offline

Quote
Like Avobolt in thread "Rainbow Welcome"
Avobolt has written
addhook("join","welcome")
function welcome(id)
msg2(id,rainbowtext("Welcome!"))
end

but for ipairs and not txt ("Welcome!"))

roughly 0x45525A1,
so it don't fit me!
else i dont make this thread

old Re: Random chat colors?

MikuAuahDark
User Off Offline

Quote
user MikuAuahDark has written
there is a thread almost like this before and it showed on recent forum posts.


you can simply edit it:
1
2
3
4
5
6
7
8
9
10
11
rainbow = {33333}

addhook("say","talk")
function talk(id)
	for _, in ipairs(rainbow) do
		if player(id,"usgn")=usgn then
			msg(id,rainbowtext("«FunnyMan»").." whatever here")
			-- return 1 -- disable if necessary
		end
	end
end

old Re: Random chat colors?

VADemon
User Off Offline

Quote
Here's the true rainbow chat:


But I'll probably never release that (or maybe later with a better in-game API) because of the limited characters (every char needs 10 chars to define a color > results in cut messages)
edited 1×, last 24.05.19 08:29:05 pm

old Re: Random chat colors?

TopNotch
User Off Offline

Quote
user strelok_953 has written
Sorry! i mean Random
i think Rainbow is Random-my English =/

So you want a random color each time you send a message?
Spoiler >

old Re: Random chat colors?

MikuAuahDark
User Off Offline

Quote
1
msg(string.format("\169%03d%03d%03d",math.random(0,255),math.random(0,255),math.random(0,255))..player(id,"name")..": "..txt)
Code above is better than user TopNotch cs2d lua cmd msg code. so you may need to replace it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview