How do I get the player from this script?

I have an OverheadUI that’s currently inside of StarterCharacterScripts.
image

The OverHead server-side script is as follows:

task.wait()
GUI = script.PlayerUI:Clone()
GUI.Parent = script.Parent.HumanoidRootPart
GUI.Enabled = true

The script simply clones the overhead to the player, however, I was wondering how I would get the players name within the OverHead server-side script? I wanted to get the players name, and check if they have a pass, and if they do their “Name” TextLabel color should be golden. I’m aware of how to check for the gamepass and how to change the TextLabel color if it’s owned, however, I’m not sure how to get the players name within the script. Please let me know with any advice or tips you may have, thanks alot!

1 Like

task.wait()
local Player = game.Players:GetPlayerFromCharacter(script.Parent)
if Player then
GUI = script.PlayerUI:Clone()
GUI.Parent = script.Parent.HumanoidRootPart
GUI.Enabled = true

end

2 Likes

Thanks so much! :happy3: (char limit)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.