im such a forehead. I was today years old when I figured out what Archivable button does
xDD funny! Welp, I didnt thought the problem was that little detail xD
Same! actually works perfectly now… smh lol
lol would you know how to auto close another frame when you click another one?
you can just do something like this:
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v:IsA("Frame") then
if v.Name ~= frame.Name then
v.Visible = false
end
end
end
doesn’t work? what did I do wrong? I’m using scrolling frames so I changed the IsA part
does v.name also need to be Scrollingframe.Name?
well then just change this line:
if v:IsA("Frame") then
to this:
if v:IsA("ScrollingFrame") then
that’s what I have though, just added it above the other visible line, is it possible its not finding the children?
local toggle = script.Parent
local frame = script.Parent.Parent.TrailFrame
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v:IsA("ScrollingFrame") then
if v.Name ~= frame.Name then
v.Visible = false
end
end
end
toggle.MouseButton1Click:Connect(function()
frame.Visible = true
end)
it could be that, do you have your other frames Archivable?
Actually. Thats not the problem. You need to put it inside of the mouseclick function.
haha no! I can get button working for all of them without the V:isa but I don’t want them overlapping because when I open one, and then another it the other one just stays open under the new click
should be working fine though because those are the only scrolling frame children in the parent… hmm could I use player.playergui.shopgui.shop:GetChildren()
weird
no, because sometimes that could cause everyone’s to go visible or invisible.
here is the way I meant the script to be:
local toggle = script.Parent
local frame = script.Parent.Parent.TrailFrame
toggle.MouseButton1Click:Connect(function()
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v:IsA("ScrollingFrame") then
if v.Name ~= frame.Name then
v.Visible = false
end
end
end
frame.Visible = true
end)
im already using that type of script for my shop close button… that could cause all players with shop open for it to be closed even if its a local script??
local player = game.Players.LocalPlayer
local Window = player.PlayerGui.ShopGui.Shop
local textbutton = player.PlayerGui.ShopGui.Shop.Close
textbutton.MouseButton1Click:Connect(function()
Window.Visible = false
print ("test")
end)
this works flawlessly must be because its actually in function now
e
thanks <3
yes, because it doesnt matter who clicks the button, it would get all of the players in the server (because it doesnt recognize who clicked the button) and close the frames for each player.
would be such a troll game if that was a feature! alright I’ll change it thanks for the help!