Hi, I’m making a radio for my game. I’m making a radio system where people can chat over the radio. Currently it’s not working, and I’ve been trying it for a few days. Help would be appreciated!
Local Script:
local Channels = {"GlobalNet", "TacticalNet", "CommandNet"}
local CurrentChannel = "GlobalNet"
--I won't show the code that's already tested and has no problem
--Remote Function
Player.Chatted:Connect(function(Message)
if Activate == false then return end
--print(Player.Name.." "..CurrentChannel..": "..Message)
RadioEvent:FireServer(Message, CurrentChannel)
--print(CurrentChannel)
end)
Callback.OnClientEvent:Connect(function(FrametoOutput, ConfiguredMessage)
FrametoOutput.M1.Text = ConfiguredMessage
print(ConfiguredMessage)
end)
--Server script
function DisplayMessage(FrametoOutput, Message)
FrametoOutput.M1.Text = Message
end
--M1 = TextBox
function ConfigMessage(Player,Message,CurrentChannel)
local RadioUi = game.StarterGui.RadioUI
local FrametoOutput = RadioUi.RadioFrame:FindFirstChild(CurrentChannel)
local ConfiguredMessage = Player.Name..": "..Message
--Callback:FireAllClients(FrametoOutput, ConfiguredMessage)
DisplayMessage(FrametoOutput, ConfiguredMessage)
--print(ConfiguredMessage)
end
RadioEvent.OnServerEvent:Connect(function(Player,Message,CurrentChannel)
ConfigMessage(Player, Message, CurrentChannel)
--print(CurrentChannel)
end)
This doesn’t work, help would be appreciated.