Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Suppose to change the text to your username but it doesn't. Why?

Asked by
AdamTHM -1
4 years ago
Edited 4 years ago
local screen = game.StarterGui.SecurityScanner1
                    screen.ImageLabel.Name.Text = ""..Player.Name
            screen.ImageLabel.Name.Text = ""..Player.Name

I have no idea why it's not working did I forgot to add some extra code that is required?

Error: Workspace.BitTech Scanner.Scanner.ScreenScript:13: attempt to index field 'Name' (a string value)

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
4 years ago

That's because things in the startergui are cloned into a player's playergui

So you want to get the player's playergui

local Player=game.Player.LocalPlayer

local screen = Player.PlayerGui.SecurityScanner1
                    screen.ImageLabel.Name.Text = ""..Player.Name
            screen.ImageLabel.Name.Text = ""..Player.Name
0
Oh I can't believe I forgot that. AdamTHM -1 — 4y
Ad

Answer this question