local ProximityPrompt = script.Parent local Torch = script.Parent.Parent local Jailcell = game.Workspace:FindFirstChild("Jailcell1") local Wrecked = game.Workspace:FindFirstChild("WreckedJailDoor") ProximityPrompt.Triggered:Connect(function() if ProximityPrompt.ActionText == "Burn a hole trough the jail door?" then wait(2) Jailcell.Position = Vector3.new(-75.25, 5, -191.5) ProximityPrompt.ActionText = "Burned..." else wait(0.5) workspace.Basement.Doors.Jailcell1:Destroy() wait(0.1) game.Workspace:FindFirstChild("WreckedJailDoor").Transparency = 0 game.Workspace:FindFirstChild("WreckedJailDoor").CanCollide = true game.Workspace:FindFirstChild("WreckedJailDoor").Anchored = true return end end)
Im trying to make it so that the original jailcell gets destroyed, but then want the Wrecked version with the hole in it to be seeable and be collided with, and keep getting the error.
Hiya! o/
The error that's being supplied is telling us that on line 15, it attempts to find "WreckedJailDoor" in Workspace, but it's returning nothing. Perhaps the object is getting destroyed somewhere during runtime? Could you confirm that the door is still in workspace after you tried to trigger the prompt?
Another cause could be because you might be spelling it wrong?
Also might I add you can use the variables you created earlier in your code
local ProximityPrompt = script.Parent local Torch = script.Parent.Parent local Jailcell = game.Workspace:FindFirstChild("Jailcell1") local Wrecked = game.Workspace:FindFirstChild("WreckedJailDoor") ProximityPrompt.Triggered:Connect(function() if ProximityPrompt.ActionText == "Burn a hole trough the jail door?" then wait(2) Jailcell.Position = Vector3.new(-75.25, 5, -191.5) ProximityPrompt.ActionText = "Burned..." else wait(0.5) Jailcell:Destroy() wait(0.1) Wrecked.Transparency = 0 Wrecked.CanCollide = true Wrecked.Anchored = true return end end)