When the scripts parent is pressed it makes a part invisible this script used to work in the actual play mode but now it only works in roblox studio i don't understand why. be VERY SPECIFIC STEP BY STEP when explaining the problem
Debounce=false
function onClicked()
if not Debounce then
Debounce=true
script.Parent.BrickColor=BrickColor.new("Really red")
Workspace.invisibleD.Transparency=1
Workspace.invisibleD.CanCollide=false
wait(3)
Workspace.invisibleD.Transparency=0
Workspace.invisibleD.CanCollide=true
wait(5)
script.Parent.BrickColor=BrickColor.new("Lime green")
Debounce=false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
This is another script when a gui button is clicked its suppose to open a frame
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Frame.Visible=true
script.Parent.Parent.Frame.VoteText.Visible=true
script.Parent.Parent.Frame.CloseButton.Visible=true
end)

3 comments
i dont really get how to use Part:WaitForChild() or Part:FindFirstCHild to fit into my script giving me an example would be nice.
Sure, WaitForChild waits for a children with a specific name, because you never know if the script you just made will run before the objects appear, so it waits for them first, pausing the current thread, if it already exists then it will instantly recognize it. FindFirstChild FINDS a child with a specific name instantly, if it doesn't exist it will return nil so you can use if Part:FindFirstChil
if Part:FindFirstChild("lol") then or if Part:FindFirstChild("lol")==nil then