Making a dumb thing, function wotn work

Petum.Disconnect = function()
	print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	local Pete = script.Parent.MeshPart
	local Frame = script.Parent.Parent.CrashFrame
	task.wait(1)
	Frame.Visible = true
	
	local Playing = true
	
	task.spawn(function()
		while Playing == true do
			Frame.Cam.Visible = false
			task.wait(0.5)
			Frame.Cam.Visible = true
			task.wait(0.5)
		end
	end)
	
	task.wait(5)
	
	Frame.Visible = false
	Playing = false
end

this function at the very least should print, but it just does nothing when called
i have other functions set up the same way and they work fine

Just to make sure, are you trying to run code when a RBXScriptConnection disconnects?

Can you show where the function is called?

1 Like

no im not, its just called that

No I mean, where in the script does it say Petum.Disconnect()? In other words, where is the function activated? Can you show how it is activated?

Edit: Sorry I thought you were talking to me