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.
1 | function myFunction(player) |
2 | local part = workspace.Part |
3 | local clone = part.GUI:Clone() |
4 | clone.Parent = player.PlayerGui |
6 | 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.