I have a LocalScript in a tool that will send a RemoteEvent to the server called 'messageSend', once a player chats in the chat. The RemoteEvent's paramaters should contain the player's name, and the player's message. However, once the server recieves the RemoteEvent, it appears that only the player's name has been sent, as when I print both, the player's username is printed twice, instead of once, followed by the player's message. Could you help please?
LocalScript:
player = game:GetService("Players").LocalPlayer
player.Chatted:Connect(function(msg)
msg = tostring(msg)
game:GetService("ReplicatedStorage").Events.messageSend:FireServer(player, msg)
end)
ServerScript:
local function eventFired(player, msg)
print(player.Name)
print(msg)
end
game:GetService("ReplicatedStorage").Events.messageSend.OnServerEvent:Connect(eventFired)

2 comments
You don't need to pass player as an argument with FireServer, only FireClient.
Yes I do, as I am wanting the fire all clients in the serverscript after I have the paramaters figured out.