It's going to be a single-player game and I'm trying to make the surface GUI on a door be set to local players name but it isn't working
local player = game.Players.LocalPlayer.Name
script.Parent.Parent.TextLabel.Text = player
It's going to be a single-player game and I'm trying to make the surface GUI on a door be set to local players name but it isn't working
local player = game.Players.LocalPlayer.Name
script.Parent.Parent.TextLabel.Text = player
If its a single player game you can just get all the players in the game(1) and chose the first player(you), so it might look like this
local players = game.Players:GetPlayers()
surfaceGui.TextLabel.Text = players[1].Name
would this go into a script inside the surface gui?
if you put this inside the surface gui you would slightly tweak it to look like 'script.Parent.TextLabel.Text = players[1].Name'
that is what i did but it seems to not work for some reason as a server script and there are no errors
you can't use LocalPlayer in a server script.
it still doesn't work in a local script
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Can you include your script?