Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

ASGP is not a valid member of PlayerGui?

I don't know whats wrong. I look in PlayerGui, and the ScreenGui named "ASGP" is definitely there. Need help.

Code is in a Local Script

local frame = script.Parent.Parent.Parent.Parent.ASGP.Frame --game.StarterGui.ASGP.Frame

script.Parent.MouseButton1Click:connect(function()
	frame.Visible = true
end)

1 answer

✓ Accepted answer

Hello Tyler i'm here to help you. The best is use a «service» to find anything on a PlayerGui.

local Players = game:GetService('Players') 
local Player = Players.LocalPlayer
local PlayerGui = Player :WaitForChild('PlayerGui') -- WaitForChild is really important when you search anything on a UI
local ScreenGui = PlayerGui:WaitForChild('ASGP')
local frame = ScreenGui:WaitForChild('Frame')

script.Parent.MouseButton1Click:connect(function()
    frame.Visible = true
end)

You can make it too

script.Parent.MouseButton1Click:connect(function()
    game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui '):WaitForChild('ASGP'):WaitForChild('frame').Visible = true
end)

1 comment

1

Thank you so much.

This discussion is preserved as it was. New answers, comments, and votes are closed.