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)
Probably the pathfinding common problem, please consider looking through old questions before posting.
You can't just use script.Parent.Parent.Parent.Parent to do certain things, the possibilities of your script to break could increase.
You really never know whenever one of these "Parent.Parent.Parent.Parent..." doesn't exist yet or just doesn't exist.
This is why Part:WaitForChild("Noob") and Part:FindFirstChild("AnotherNoob") are useful.
I agree with 6Pen, maybe the object is nil, meaning the Frame doesnt exist, like you added too many or too much parents. So try doing something like this incase the script breaks:
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 script.Parent.MouseButton1Click:connect(function() if script.Parent.Parent:findFirstChild("Frame") then onClicked() end end)