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

Radio script not working correctly?

Hello! This script I used to make a Radio isn't fully working, since messages I send are not always shown to other people... could anyone help me?

I have a Chatstorage folder in workspace and a ChatHandler script too. Plus of course a GUI for the Radio, here are the scripts.

ChatHandler in workspace.

local chatstorage = game.Workspace.Chatstorage

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(theirmessage)
		local stringval = Instance.new("StringValue", chatstorage)
		stringval.Name = "["..plr.Name.."] "..theirmessage
	end)
end)

In Radio GUI.

local chatbox1 = script.Parent.Parent.Chat.CB1
local chatbox2 = script.Parent.Parent.Chat.CB2
local chatbox3 = script.Parent.Parent.Chat.CB3
local chatbox4 = script.Parent.Parent.Chat.CB4
local chatbox5 = script.Parent.Parent.Chat.CB5
local chatbox6 = script.Parent.Parent.Chat.CB6
local chatbox7 = script.Parent.Parent.Chat.CB7
local chatbox8 = script.Parent.Parent.Chat.CB8

game.Workspace.Chatstorage.ChildAdded:Connect(function(chatstuff)
	script.Sound:Play()
	chatbox1.Text = chatbox2.Text
	chatbox2.Text = chatbox3.Text
	chatbox3.Text = chatbox4.Text
	chatbox4.Text = chatbox5.Text
	chatbox5.Text = chatbox6.Text
	chatbox6.Text = chatbox7.Text
	chatbox7.Text = chatbox8.Text
	chatbox8.Text = chatstuff.Name
wait(0.1)
end)

2 comments

0

Can You Tell Me Where Do You Get The Error From i Mean Which Line

0

@kidsteve923 There is no error, it's just like this.

1 answer

Use RemoteEvent to fire the message to all clients.

3 comments

0

How do I do it?

0

The developer hub has a great article on that: https://developer.roblox.com/en-us/api-reference/class/RemoteEvent

0

This video might help you to understand what is a RemoteEvent - https://www.youtube.com/watch?v=wCr5VXJ34T4 . Also you can learn what is a RemoteFunction as well https://www.youtube.com/watch?v=XPI3EYelWzY

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