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

Radio script not working correctly?

Asked by 3 years ago

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)
0
Can You Tell Me Where Do You Get The Error From i Mean Which Line kidsteve923 139 — 3y
0
@kidsteve923 There is no error, it's just like this. Fixer1987 95 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

Use RemoteEvent to fire the message to all clients.

0
How do I do it? Fixer1987 95 — 3y
0
The developer hub has a great article on that: https://developer.roblox.com/en-us/api-reference/class/RemoteEvent NotFrindow 346 — 3y
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 MrSuperKrut 167 — 3y
Ad

Answer this question