I think my pc is cursed, or maybe its the game idk, nothing is working :cryemotes:
https://gyazo.com/d3ad69550d8eed7f78e66dd8ec89fb55
Soo before the textbutton was outside of the GUI and then it was inside the GUI and now itās inside the frame. After every solution Iām giving you, youāre changing the hierarchical order so that the variables arenāt properly indexing the components. Iām not sure how to help you anymore, sorryā¦
Hello, there is an error with the script you wrote.
local GUI= CharSelectShop
game.Players.LocalPlayer.Player.Gui.CharSelectShop -- Also what's with this line exactly? Fix it or remove maybe...
local Button = TextButton
locaal function Toggle()
if CharSelectShop and TextButton then
GUI.Visible ==true -- == is used on if statements
GUI.Visible = false -- You are making it invisibile again.
else
GUI.Visible = true
end
end
TextButton.MouseButton1Down:Connect(Toggle)
To fix this, hereās the correct script:
local CharSelectShop = game.Players.LocalPlayer.Player.Gui.CharSelectShop -- I tried fixing it for you to match this script.
local GUI = CharSelectShop
local Button = TextButton
locaal function Toggle()
if CharSelectShop and TextButton and GUI.Visible == false then -- You wanna check if the GUI is already visible
GUI.Visible = true -- now it's only
else
GUI.Visible = false
end
end
TextButton.MouseButton1Down:Connect(Toggle)
I would say that
local function Toggle()
would be right
script.Parent.Parent = script.Parent.Parent.Parent--?
script.Parent.Position = Udim2.new()-- Usually, when you change an GUI's parent, they go to an random position, so put here the Udim2 you want.
local Button = script.Parent--Variable of the Button.
local Frame = Button.Parent:WaitForChild("Container")--Variable of the Frame(Container)
Button.MouseButton1Click:Connect(function()
Frame.Visible = not Frame.Visible--Makes the boolean property of the frame(Visible), the reverse of what it currently is.
end)
If you didnāt understand, donāt hesitate on direct messaging me here on the forum.
If you guys noticed an error, then i will edit the code to fix it.
If you put the textbutton in the screengui and not the frame, the code DaCrazyDev gave you should work.
I vouch for you bro! It works and its extremely helpful
ll give you coins in the game whenever its released as a added bonus