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

How do I find the player from StarterGui with a normal script?

Asked by 10 years ago

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?

0
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. GoldenPhysics 474 — 10y
0
Thanks, but I was about to use :PlayerHasPass() which only works on server script... fahmisack123 385 — 10y
0
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.?) Chili1924 150 — 10y
0
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) fahmisack123 385 — 10y

Answer this question