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

Shop GUI wont switch GUI's when I click on a gun section (Please answer :)?

I'm making a Shop GUI for an upcoming game, and I want it to have sections like guns. Pretty much when you click on a button it shows a gun section, and when you click on another it shows a character section. Here is the script:

OpenGuns = script.Parent:WaitForChild("Guns")
Gun1 = script.Parent:WaitForChild("Gun1")
ScrollingFrame = script.Parent.Parent.Parent.Parent:WaitForChild("ScrollingFrame")
Blue = Color3.new(27, 103, 202)
Characters = script.Parent.Parent:FindFirstChild("Characters") 
Grey = Color3.new(98, 98, 98)
Box = script.Parent.Parent:WaitForChild("Box")
Box2 = script.Parent.Parent.WaitForChild("Box2")
Box.Visible == true 



function OnClicked()
	if Box.Visible == true then
	Gun1.Visible = true
	Box.Visible = false
	Box2.Visible = true
	GunButton.BackroundColor3 = Blue
	Characters.BackroundColor3 = Grey
end

OpenGuns.MouseButton1Down:connect(OnClicked)

Here are the arrangment of things like ScreenGUI's and frames: -StarterGUI --ScreenGui ---LocalScript ---Box ----ScrollingFrame -----Stene - 85 credits -----Erica-105 credits ----Characters ----Guns -----LocalScript(The one I typed out) -----Gun1 ----Open/CloseShop Thx!

-club101coolguy


2 comments

0

any output?

0

no

1 answer

The if statement on line 14 is not closed with an end.

1 comment

0

Still doesn't work :/

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