Why is my remote event callback stating my name in the output and not the message

What do I mean by this? Basically I have a script on the client that fires a remote event to the server, And this event isn’t cooperating with me and is saying my name and not the message


Client:

test.MouseButton1Click:Connect(function()
	local Message = string.lower(tostring("Hey!"))
	remotes:WaitForChild("SendVote"):FireServer(plr, Message)
end)

Server:

Remotes.SendVote.OnServerEvent:Connect(function(Message)
	print(Message)
end)

The first argument of the server event is always the player who fired it,
a simple fix would be

Remotes.SendVote.OnServerEvent:Connect(function(plr, Message)
	print(Message) -- prints the argument
end)

and firing the server the plr object is not needed at all.

1 Like


I removed the plr Part and now it just prints my name in lowercase.

1 Like

Oh I think you misunderstood,
This is the client:

test.MouseButton1Click:Connect(function()
	local Message = string.lower(tostring("Hey!"))
	remotes:WaitForChild("SendVote"):FireServer(Message) -- plr is not needed
end)

This is the server:

Remotes.SendVote.OnServerEvent:Connect(function(plr, Message)
	print(Message)
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.