hello all! im have one problem. PopUp can open frame only one? To open many times. How fix one to many times?
Open PopUpGui:
local popUp = script.Parent.PopUpGui script.Parent.Touched:Connect(function(hit) if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then local plr = game.Players[hit.Parent.Name] if plr:FindFirstChild("PlayerGui") and not plr.PlayerGui:FindFirstChild(popUp.Name) then popUp:Clone().Parent = plr.PlayerGui end end end)
Close PopUpGui:
buttonclose = script.Parent frame = buttonclose.Parent function onClicked(popUp) frame:remove() end script.Parent.MouseButton1Click:Connect(onClicked)
Alright so the main issue I see here is the :destroy() command. I don't think you understand what this does, when you use the Destroy function, it removes it from the game entirely. I would recommend doing this instead. Here's a page that explains the Destroy command.
Open/Close Gui Script
This goes into a local script inside of the gui button. This will open and close the GUI without destroying it. Hope this helps.
--Made By MillerrIAm-- ----Variables buttonclose = script.Parent frame = buttonclose.Parent ----Main Script script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true else frame.Visible = false end)
If this answers your question, please make sure to mark it as the answer/solution!