GUI button not working

Hey there! I’m not sure why this isn’t working but when I press the button it doesn’t show an error in the output it just doesn’t work. Here’s the script:

(first line works though)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.LocalScript.Click:Play()
	
	local frame = game.StarterGui.ScreenGui
	frame.Frame.Visible = true
	frame.GravityCoil.Visible = true
	frame.SpeedCoil.Visible = true
	frame.RainbowTrail.Visible = true
	frame.VIP_Commands.Visible = true
	frame.GravityCoilButton.Visible = true
	frame.SpeedCoilButton.Visible = true
	frame.RainbowTrailButton.Visible = true
	frame.VIP_CommandsButton.Visible = true
end)
1 Like

You cant use StarterGui.
Try to use

local player = game.Players.LocalPlayer
local frame = player.PlayerGui.ScreenGui

This needs to be in local script.

3 Likes