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

someone help with my chat gui?

Asked by
Teeter11 281 Moderation Voter
10 years ago

There is no error in the output and i dont know why its not working so i was wondering if someone could help. --this script is in workspace



players = game.Players:GetChildren() game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) for i = 1,#players do chatbox = script.Chat:Clone()--clones a gui in the script chatbox.Text = player.Name-- changes the name of the gui to the players name chatbox.ChatText = msg-- changes the text guis name space = players[i].PlayerGui.Chat.ChatSpace--gets the players space for chats chatbox.Parent = space--puts the chat in the chatspace end end) end)
0
You will get more help if you take the time to make your question legible. Place code within a code block. The code you placed in your question includes comments which can't be distinguished from your code. AxeOfMen 434 — 10y
0
it glitched i remember putting it in the code block. Teeter11 281 — 10y

1 answer

Log in to vote
1
Answered by
AxeOfMen 434 Moderation Voter
10 years ago

The problem is on line 1. You are getting the players that exist when the script is first run. The script first runs when the game starts. This means there will be no players in the game when the script runs and the players variable will be an empty table. Move line 1 inside the Chatted event handler to fix this problem.

Good luck!

Ad

Answer this question