Attempt to concatenate Instance with string

My log script isnt working, i dont know why.

Server script -

game.ReplicatedStorage.Log.OnServerEvent:Connect(function(player,amount,other)
		wait()
		local data = {
			['embeds'] = {{

				['title'] = "AdminGUI Used",
				['description'] = player.." gave "..other.." "..amount.." EXP.",
				['color'] = 16724553

			}}
		}
		wait(2)
		game:GetService("HttpService"):PostAsync("xxxxxxxxxxxxxxxxxx", game:GetService("HttpService"):JSONEncode(data))
		print(player)
	end) 

Local Script -

script.Parent.MouseButton1Click:Connect(function()

local amount = script.Parent.Parent.FullAmount.Text

local other = script.Parent.Parent.PLR.Text

game.ReplicatedStorage.Log:FireServer(amount,other)

end)

11 Likes

The error is literal: you’re trying to concatenate an instance to a string. The first argument passed to OnServerEvent is a player instance. You should be fetching their name instead. Just add .Name to player in your description index.

11 Likes

The reason you’re getting that error is because you’re doing

player.."string"

player is the player itself, so it’s an instance. You want to print the name, so just add .Name after it.

28 Likes