Let's say I have a script inside a Frame, inside the StarterGui. How do I find the player???
Would I use script.Parent.Parent.Parent Or is there a shorter way?
Let's say I have a script inside a Frame, inside the StarterGui. How do I find the player???
Would I use script.Parent.Parent.Parent Or is there a shorter way?
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
First of all, the Player's GUI is called PlayerGui. Nothing happens in StarterGui. Second, make sure it's a local script as those run client side. Lastly, game.Players.LocalPlayer is what you're talking about.
Thanks, but I was about to use :PlayerHasPass() which only works on server script...
When do you want the script to check for the Game Pass? (When the player steps on a brick, enters the game, clicks on a TextButton, etc.?)
Here's the whole script: if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent.Parent, id) then script.Parent.Parent:Destroy() end (script.Parent.Parent is a ScreenGui)