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)

1 comment
I would assume you're using a ServerScript to open the gui? And if you create an instance with a ServerScript, then destroy it with a LocalScript, the server can't see it