Hello there, I am having a problem with the PlayerGui property of the player. I am trying to access the player's PlayerGui, but it will not work.
My script:
function myFunction(player) local part = workspace.Part local clone = part.GUI:Clone() clone.Parent = player.PlayerGui end myFunction()
Can somebody help me?
If you are using a local script to do this, you can find the player by using game.Players.LocalPlayer, and use the example below.
function myFunction(player) local part = workspace.Part local clone = part.GUI:Clone() clone.Parent = player.PlayerGui end myFunction(game.Players.LocalPlayer)
If this is a server script, you need to get another way to find that player. If that is the case, please write a response saying what you need to happen to have the function happen. From there, I can help you further.