I am completely confused. I put a '?' in the spot where I don't know what to put.
function claim() script.Parent.Parent.OwnerName.SurfaceGui.Owner.Text = "Owned by: "..?.."" -- What do I put where the '?' is? end script.Parent.Touched:connect(claim)
Try this
script.Parent.Touched:connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then script.Parent.Parent.OwnerName.SurfaceGui.Owner.text = "Owned by: "..hit.Parent.Name end end)
Here we: - Define the function in the event, to save space. - Make the argument hit inside the function, with the Touched event the only argument is the thing that touched it. - Check to make sure the parent of what touched it is a Player - If the thing that touched it is a child of a Player, then it makes the text have that name in it
If this helped remember to make it the correct answer, thank you, and you're welcome. :)