How to make golden freddy dissapear?

Hello! FNAF 1 has an Easter egg with a golden Freddy. I made it so that if a player receives an Easter egg, then the golden Freddy teleports to the office, in order to drive him away, you need to open the tablet and it instantly disappears, and if you don’t open it and wait 10 seconds, then Freddy jumpscares you. But my script doesn’t work the way I wanted: if you open the tablet and wait 10 seconds, then it will disappear. And so if you don’t open it, you will die.

Script:

script.Parent.Touched:Connect(function(hit)
		if hit.Parent.Name == "Golden_Freddy" and hit.Parent:FindFirstChild("ColdBloodedKiller") then
		if game.Workspace.MonitorOpening.Checking.Value == false then -- I'm made so that the player does not die when Freddy is in the office while he is sitting on the cameras, only when he removes the tablet that Freddy can harm.
			wait(10)
			if game.Workspace.MonitorOpening.Checking.Value == true then
			game.Workspace.Golden_Freddy:SetPrimaryPartCFrame(game.Workspace.GoldenFreddy["W0"].CFrame)
			else
                game.Workspace.Jumpscare:Play()
			end
			end
		end
	end)

Is MonitorOpening.Checking changed by a localscript or a script?

It’s the wait(10) that is the issue. That is forcing the game to wait 10 seconds before checking if you have the tablet opened up.
Basically what you want to do is have the game waiting if the Value changes to true within a 10 second interval, then if so it skips the jumpscare. If not, it goes to the jumpscare. There’s probably a better way, but you could make it use either the RunService.Stepped or RunService.Heartbeat events to check every frame for 10 seconds if the player has their monitor opened, and after those 10 seconds it disconnects the event, then runs the jumpscare

MonitorOpening.Checking changed by a script. I’m said script works, but not in the way I wanted

Okay, i get what you mean. But I don’t really understand how RunService.Stepped. Could you make a script and explain what applies to what?

I deleted the post because I’m still confused. What is firing this touch function? Is there any debounce??

Nope, but this work’s for me.

  1. List item