Script doesn't works as expected

The script works but the chat message says “Instance” and not the message that the player said in the chat.

Localscript:

local radioEvent = game.ReplicatedStorage.RadioChatted

local Player = game.Players.LocalPlayer

local Team = game:GetService("Teams")["Humans"]

Player.Chatted:Connect(function(message)

if Player.Team == Team then

game.ReplicatedStorage.RadioChatted:FireServer(message)

end

end)

Script:

local radio = script.Parent.Handle
game.ReplicatedStorage.RadioChatted.OnServerEvent:Connect(function(message)
game:GetService("Chat"):Chat(radio, message, Enum.ChatColor.White)
end
end)

The first argument of OnServerEvent is the player that fired the event. So do player, message in the parameter list.

1 Like