Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this Chat Gui working?

Asked by 10 years ago
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?

0
You're on the right track, but several things are REALLY wrong. Give me a minute to post an answer. DiamondBladee 135 — 10y
0
ok NinjoOnline 1146 — 10y
0
The admin variable is never used again after you declared it. Is this the full script? OniiCh_n 410 — 10y

1 answer

Log in to vote
0
Answered by
Tkdriverx 514 Moderation Voter
10 years ago

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 ^~--
0
The script isnt in the gui, its in workspace, while the GUI is is ScreenG NinjoOnline 1146 — 10y
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. Tkdriverx 514 — 10y
0
I just made a small change to it. Try it, it should work just fine. Tkdriverx 514 — 10y
Ad

Answer this question