where to write this what line where to write this what line
your script still doesn’t open
local Player = game.Players.LocalPlayer
local visible =
Player.PlayerGui.GamepassShop["Open/Close"].Parent.Parent.CodeGui["Open/Close"]
script.Parent.MouseButton1Click:Connect(function()
if visible then
script.Parent.Parent.Parent.GamepassShop["Open/Close"].Visible = false
script.Parent.Parent.Parent.CodeGui["Open/Close"].Visible = false
script.Parent.Text = "<<<"
else
script.Parent.Parent.Parent.GamepassShop["Open/Close"].Visible = true
script.Parent.Parent.Parent.CodeGui["Open/Close"].Visible = true
script.Parent.Text = ">>>"
end
end)
still not working XD i trying in roblox studio
I have no clue then… I tried.
I’m sorry for wasting your time.
1 Like
Create a local script inside the GamePassShop.
local GamePassShop = script.Parent
local FrameToOpen = GamePassShop.Frame --> Where Ever The Frame Is Located
local Button = GamePassShop["Open/Close"]
local ButtonText = Button.Label --> Where Ever The ">>>" Text Label Is
Button.MouseButton1Click:Connect(function()
FrameToOpen.Visible = not FrameToOpen.Visible --> If The Frame is Visible, It Will Set It To False. If The Frame is Not Visible, It Will Set To To True
ButtonText.Text = (FrameToOpen.Visible == true and ">>>") or (FrameToOpen.Visible == false and "<<<")
end)
Just add a
local openclose = opened
-- When button is clicked do this
if openclose == opened then
openclose = closed
-- Make gui disappear
else
openclose = opened
-- Make gui appear
end
where to add? I don’t understand just
Final script (make my reply the solution if it helped)
local openclose = opened
local gui = game.StarterGui.GameapssShop.Parent.CodeGui
script.Parent.MouseButton1Click:Connect(function()
if openclose == opened then
openclose = closed
script.Parent.Parent.Parent.GamepassShop["Open/Close"].Visible = false
script.Parent.Parent.Parent.CodeGui["Open/Close"].Visible = false
script.Parent.Text = "<<<"
else
openclose = opened
script.Parent.Parent.Parent.GamepassShop["Open/Close"].Visible = true
script.Parent.Parent.Parent.CodeGui["Open/Close"].Visible = true
script.Parent.Text = ">>>"
end
end)
Oops my bad lol, here’s the fixed version
Also, I don’t want to just tell you the whole script, you need to learn, so I’d recommend learning more and not just waiting for someone to write a script for you.
local openclose = "opened"
local gui = game.StarterGui.GameapssShop.Parent.CodeGui
script.Parent.MouseButton1Click:Connect(function()
if openclose == "opened" then
openclose = "closed"
script.Parent.Parent.Parent.GamepassShop["Open/Close"].Visible = false
script.Parent.Parent.Parent.CodeGui["Open/Close"].Visible = false
script.Parent.Text = "<<<"
else
openclose = "opened"
script.Parent.Parent.Parent.GamepassShop["Open/Close"].Visible = true
script.Parent.Parent.Parent.CodeGui["Open/Close"].Visible = true
script.Parent.Text = ">>>"
end
end)
I kind of wrote a script on the top myself and checked what you sent me not working script
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.