i tried to make it but i have no idea to make it. please help me.
Forum
Scripts
custom color when player say
custom color when player say
5 replies
1

i tried to make it but i have no idea to make it. please help me.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Color = {}
addhook("say", "HookSay")
HookSay = function (id, txt)
	if txt:sub(1, 6) == "@color" then
		local clr = tostring(txt:sub(8,17))
		if #clr == 9 then
			Color[id] = clr
			msg2(id, "Color has been changed!")
		else
			msg2(id, "Color is wrong!")
		end
	else
		msg((Color[id] and "\169"..Color[id] or "")..player(id, "name")..": "..txt)
	end
	return 1
end
function TColor(t,c,m,C)
t=t or '';c=c or '000000000';C=C or '@C'
if (m==0) then
return "\169"..c..t..C
elseif (m==1) then
return (string.char(169))..c..t..C
else
return "\xA9"..c..t..C
end
end
t="Text message";c=255255255
print (TColor()) -- ©000000000
print (TColor(t)) -- ©000000000Text message
print (TColor(t,c)) -- ©255255255Text message
print (TColor(t,c,0)) -- ©255255255Text message
print (TColor(t,c,1)) -- ©255255255Text message
print (TColor(t,c,1,"")) -- ©255255255Text message I coded this to attach text color to text via 3 methods, merry christmas.
Avo and
KimKat
KimKat: Your code is not going to work properly.
1
2
3
2
3
t="Text message" c=001255255 print (TColor(t,c))
1
©1255255Text message@C
1
©001255255Text message@C
1
2
3
2
3
t="Text message" c="001255255" print (TColor(t,c))
1

Offline