Attempt to concatenate Instance with string erro

Local Script

game.ReplicatedStorage.Remotes.Finish:FireServer(Plr, Minutes, Seconds, Miliseconds)

Minute, Seconds And Milliseconds are values which are passed through a tostring function

Server Script

game.ReplicatedStorage.Remotes.Finish.OnServerEvent:Connect(function(Plr, Minutes, Seconds, Miliseconds)
	print("Finish")
	local MessageData1 = {
		["content"] = tostring(client.DisplayName).."Has finished With a Time Of "..Minutes..":"..Seconds.."."..Miliseconds
	}
end)

Thanks
LargeHotDogs13

Show us the values of Minutes, Seconds, and Milliseconds (when you fire the remote from the LocalScript)

Don’t pass in Plr yourself if Plr is a player, FireServer does that automatically

Also I don’t see client anywhere in the code you’ve provided

4 Likes

If you’re passing in plr, your server-side script is taking in the “plr” variable that your client provided as “Minutes”. This seems to be the source of the error.

1 Like

When working with FireServer or InvokeServer , the first and automatically argument sent to the server is the player firing/invoking the remote.

Thus,
Replace this:

game.ReplicatedStorage.Remotes.Finish:FireServer(Plr, Minutes, Seconds, Miliseconds)

With this:

local replicated = game:GetService("ReplicatedStorage")

replicated:WaitForChild("Remotes").Finish:FireServer(Minutes, Seconds, Miliseconds)

Hey as my good friend @EmbatTheHybrid said the first parameter is always player for

onserver events

we can fix this by simply removing the plr from the beginning parameter of the fireserver

game.ReplicatedStorage.Remotes.Finish:FireServer(Minutes, Seconds, Miliseconds)

and now it should all work together now when I first started with server and onsever events I had the same issue too :sweat_smile: lol

If your confused why this doesn’t work, it’s because the first parameter becomes the player alr seems good but the second parameter in the onserever even also turns player thats why it says that error

print(tostring(minutes)) -- itll print the player

put this in the on server event and itll print player

First, in LocalScript.

game.ReplicatedStorage.Remotes.Finish:FireServer(Minutes, Seconds, Miliseconds)

And ToString to other args.

Its meant to be plr.DisplayName

Thank You So Much This Fixed it