Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to change Textlabel's text to seat occupant?

I made a chair and I want that a text label shows the seat's occupant. Sorry for the grammar (I used google translate)

-- Serverscript
textlabel = script.Parent.Parent.NameLabel
Seat = script.Parent.Parent.Parent.Parent.Bench.Seat
while true do
wait(0.1)
textlabel.Text = game.Players:GetPlayerFromCharacter(Seat.Occupant.parent)
end

and it says ' text is not a valid member of TextLabel "TextLabel" '

1 answer

✓ Accepted answer
textlabel.Text=game.Players:GetPlayerFromCharacter(Seat.Occupant.parent.Name)

instead of

textlabel.Text = game.Players:GetPlayerFromCharacter(Seat.Occupant.parent)

Your script was setting textlabel.Text to the occupant itself

This discussion is preserved as it was. New answers, comments, and votes are closed.