"rendering is stopped for debugging" after using proximity prompt 3 times

after triggering the promimity prompt 3 times it gives the “rendering has been paused for debugging” screen. Why? here is the code that is being fired.

local SafeRoomDebounce = false
local AnimationTime = 2.2166666984558105 - 0.000000000000001 + 0.7
local EveryLever = CollectionService:GetTagged("Lever") -- collection service is declared else where
local LeverSound = game.ReplicatedStorage.Sounds.Lever

for _, Lever in pairs(EveryLever) do 
	local Model = Lever.Parent
	local Prompt = Lever.Handle.ProximityPrompt
	local AnimationTrack = Lever.AnimationController.Animator:LoadAnimation(Lever:WaitForChild("Animation")) 
-- lever animation^
	local AnimationTrack1 = Model.AnimationController.Animator:LoadAnimation(Model:WaitForChild("Animation"))
-- door animation^
	
	if Lever.Parent.Name == "SafeRoom" then
		delay(AnimationTime -0.0001, function()
			AnimationTrack1:AdjustSpeed(0)

		end)
		AnimationTrack1:Play()

	end
		
	Prompt.Triggered:Connect(function(Plr)
--
		local leverSound = LeverSound:Clone()
		leverSound.Parent = Lever
		leverSound:Play()
		delay(1.326, function() leverSound:Destroy() end)
--
		if Lever.Parent.Name == "SafeRoom" then

			if SafeRoomDebounce == false then
				print("close")
				SafeRoomDebounce = true
				
				AnimationTrack1:AdjustSpeed(1)
				delay(0.8500000238418579 -0.001, function()
					AnimationTrack:AdjustSpeed(0)
					Prompt.Enabled = true

				end)
				Prompt.Enabled = false

				AnimationTrack:Play()
			else
				print(SafeRoomDebounce)

				SafeRoomDebounce = false
				delay(AnimationTime -0.0001, function()
					AnimationTrack1:AdjustSpeed(0)

				end)
				AnimationTrack1:Play()
				AnimationTrack:AdjustSpeed(1)
				print("open")


			end
		end
	end)
end

-- all the delays are for pausing the animation at a certain time so the lever can either stay down or the doors can stay open

the code is supposed to play and pause two animations a door and a lever, lever being the only thing properally working while something wrong is with the doors animation or whatever… it doent pause the animation at all sadly idk why. everything is wrong for some reason and im literally on a deadline. but my main question for now is why it gives that dumb screen after triggering the prompt 3 times…

making a game is so hard fr

1 Like

Do you have a breakpoint anywhere in the code?

2 Likes

what is that?

sadsafjsdifuinsdjfjfdjf

It’s in the name. If you don’t understand how programs work please educate your self then most the things will become common sense.

Also use pcall/xpcall

If it wasn’t clear enough (although its at the TOP of your screen all the time) use the docs:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.