The script here that is pretty rough that I only just made doesn't work and I need help fixing it. It seemed simple to me when I first made it, but now it is an absolute headache to work with. Its for a morph I am making, and I want it so when the button is clicked, the GUI also gets cloned into the PlayerGui so only the player can view it. Any help is greatly appreciated!
local debounce = false
function onClicked(mouse)
if debounce == false then
debounce = true
script.Parent:FindFirstChild("FlashGUI"):Clone().Parent = game.Players.LocalPlayer.PlayerGui
wait(5)
debounce = false
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
