So I have a local script inside starter GUI. I also have a part with a click detector in workspace. My Code in StarterGUI:
game.Workspace.Part.ClickDetector.MouseClick:Connect(function(p) p.Parent.Head.Transparency = 1 end)
The thing is, inside a local script in starter gui, you can't get the player by using p.Parent in this case. So how would I make it so that in a local script in starter gui would make something happen to the player that only that player can see?
You can get the player by using "game:GetService("Players").LocalPlayer" and you can get the character from that player by using "game:GetService("Players").LocalPlayer.Character". Here's an example:
game.Workspace.Part.ClickDetector.MouseClick:Connect(function() local player = game:GetService("Players").LocalPlayer local character = game:GetService("Players").LocalPlayer.Character character.Head.Transparency = 1 end)