Ok, to start things off I am a complete noob at scripting 100% noob, I'm trying to make a text label that says Hello and your username And I have a screen GUI in the Starter gui and a text label inside of the gui. I don't understand much about scripting so this is what I could piece together from my knowledge Because when I test it, nothing happends and the text label does not change(This is in a local script in StarterGui):
ScreenGui = game.Players.LocalPlayer.PlayerGui.ScreenGui ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui Textlabel = game.Players.LocalPlayer.Playergui.TextLabel Textlabel.Parent = ScreenGui Textlabel.Text = "Hello " .. game.Players.LocalPlayer.Name ScreenGui.Parent=script.Parent
Thanks!
It's very simple. All you need to do is reference the player and get their name.
Also, you will want to use a Local Script, not a regular script cause a local script only runs in the player and a regular script only runs on the server. And as long as you have a screen GUI with a textlabel inside, you're all set. *If it's in Starter Gui you don't need to say ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui cause that's where it will automatically go.
-- This code would be for a local script inside of a text label. local player = game.Players.LocalPlayer local label = script.Parent label.Text = "Hello "..player.Name
Simply just do this:
-- Scripts needs to be a local script. -- Local scrip must be inside of textlabel. label = script.Parent plr = game.Players.LocalPlayer name = plr.Name label.Text = 'Hello '..name