Hello, I'm trying to setup a gui type main menu that displays the players username. I cant seem to figure it or find any guides online.
This is what i've got so far.
game.Players.PlayerAdded:Connect(function(plr)
script.Parent.Text = plr.Name
end)
Hello, I'm trying to setup a gui type main menu that displays the players username. I cant seem to figure it or find any guides online.
This is what i've got so far.
game.Players.PlayerAdded:Connect(function(plr)
script.Parent.Text = plr.Name
end)
In a local script, and create a StringValue (physically in the workspace).
local players = game:GetService("Players")
local player = game.Players.LocalPlayer
game.Workspace.StringValue.Value=player.Name
Then in a script inside of the GUI, inside of the textlabel:
script.Parent.Text = game.Workspace.StringValue
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Is it a server script or local script
At the moment it's a local script that only the player will see
you dont need player added, just define local player in a variable and set player.name to the text of your label
That worked perfectly thank you!