Script not modifying text

I made a script to automatically add a Developer tag for my name in a custom player list, but when I run the script, it says
Players.dude8074.PlayerGui.playerList.Frame.slots.dude8074.devTag:3: attempt to concatenate string with Instance

Script
if script.Parent.Text ~= "Template" and game.Players:FindFirstChild(script.Parent.Name) then
	if game.Players:FindFirstChild(script.Parent.Name).UserId == 1448128761 then
		script.Parent.Text = "[DEVELOPER] " .. game.Players:GetPlayerByUserId(game.Players:FindFirstChild(script.Parent.Name).UserId)
	end
end

Could I have help solving this issue?

Add .Name at the end of the game.Players:GetPlayerByUserId( to actually get the player’s name and not it’s instance.

The instance is the player object and not it’s name itself.

Should be something like this

if script.Parent.Text ~= "Template" and game.Players:FindFirstChild(script.Parent.Name) then
	if game.Players:FindFirstChild(script.Parent.Name).UserId == 1448128761 then
		script.Parent.Text = "[DEVELOPER] " .. game.Players:GetPlayerByUserId(game.Players[script.Parent.Name].UserId).Name
	end
end
1 Like

This worked, thank you so much!