Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't this Chat Gui working?

admin = "NinjoOnline"

child.Chatted:connect(function (msg)
	local v=Instance.new("StringValue")
	v.Value=child.Value.." "..child.Value.." "..child.Name..":  "..msg
	local col=Instance.new("Color3Value",v)
	col.Name="Color"
	col.Value=child.TeamColor.Color
	game.Debris:AddItem(v,3)
		gui=game.StarterGui.ChatService.Chats
		t1=gui.Text1
		t2=gui.Text2
		t3=gui.Text3
		t4=gui.Text4
		t5=gui.Text5
		t6=gui.Text6
			t1.TextColor3=t2.TextColor3
			t1.Text=t2.Text
			t2.TextColor3=t3.TextColor3
			t2.Text=t3.Text
			t3.TextColor3=t4.TextColor3
			t3.Text=t4.Text
			t4.TextColor3=t5.TextColor3
			t4.Text=t5.Text
			t5.TextColor3=t6.TextColor3
			t5.Text=t6.Text
			t6.TextColor3=col.Value
			t6.Text=v.Value
	v.Parent=script
end)

How come when I want say an admin to chat, it gives it a tag infront of the players name, saying "Admin" This dosen't work. What am I doing wrong?

3 comments

0

You're on the right track, but several things are REALLY wrong. Give me a minute to post an answer.

0

ok

0

The admin variable is never used again after you declared it. Is this the full script?

1 answer

✓ Accepted answer

I assume this script goes in the Gui itself? If so, this should be a LocalScript, and Gui will be the LocalScript's parent. This is a huge change, and I'm not sure if it is exactly what you want. If it's not, please let me know, and give me exactly what you want it to do, and I will try to help you.

[[[EDITED]]]

local admin = "NinjoOnline"
local gui = script.Parent
local t1 = gui.Text1
local t2 = gui.Text2
local t3 = gui.Text3
local t4 = gui.Text4
local t5 = gui.Text5
local t6 = gui.Text6

function chatEvent(player)
	player.Chatted:connect(function(msg)
		t1.TextColor = t2.TextColor
		t1.Text = t2.Text
		t2.TextColor = t3.TextColor
		t2.Text = t3.Text
		t3.TextColor = t4.TextColor
		t3.Text = t4.Text
		t4.TextColor = t5.TextColor
		t4.Text = t5.Text
		t5.TextColor = t6.TextColor
		t5.Text = t6.Text
		t6.TextColor = player.TeamColor
		t6.Text = (player.Name == admin and "[ADMIN] " or " ") .. player.Name .. ":  " .. msg
	end)
end

for _, player in pairs(game.Players:players()) do
	chatEvent(player)
end

game.Players.PlayerAdded:connect(chatEvent)

--~^ Edited and posted by Tkdriverx: Teh Penguinator ^~--

3 comments

0

The script isnt in the gui, its in workspace, while the GUI is is ScreenG

0

The one I posted will do the same thing you want it to, but it goes in the GUI. This ensures it changes everyone's GUI when someone chats.

0

I just made a small change to it. Try it, it should work just fine.

This discussion is preserved as it was. New answers, comments, and votes are closed.