Hi, i am scripting a vault door that explodes when you trigger a proximityprompt, however when the explosion has finished the vault door does not fall on the ground but seems anchored while it is not.
db = true
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
if player ~= nil and db == true then
local character = player.Character
if character:FindFirstChild("Humanoid") then
if character.Humanoid.Health >= 1 then
if character:FindFirstChild("IsInARobbery") then
if character.IsInARobbery.Value == true then db = false
script.Parent.Parent.Trigger2.Script.Disabled = true
script.Parent.ProximityPrompt.Enabled = false
script.Parent.Parent.Trigger2.ProximityPrompt.Enabled = false
character.IsInARobbery.Value = true
for i,bombs in pairs(script.Parent.Parent.Bombs:GetChildren()) do
bombs.BrickColor = BrickColor.new("Really red")
bombs.Material = Enum.Material.SmoothPlastic
end
wait(5)
local door = script.Parent.Parent.Parent.Door.Door
door.Transparency = 1
door.CanCollide = false
local newdoor = door:Clone()
newdoor.Name = "NewDoor"
newdoor.Parent = script.Parent.Parent.Parent.Door
newdoor.Transparency = 0
newdoor.CanCollide = true
newdoor.Position = newdoor.Position - Vector3.new(0,0,10)
newdoor.Orientation = Vector3.new(0, 90, -45)
newdoor.Anchored = false
local explosion = Instance.new("Explosion", game.Workspace)
explosion.Position = script.Parent.Parent.ExplosionPart.Position
explosion.BlastPressure = 0
explosion.BlastRadius = 12
script.Parent.Parent.ExplosionPart.Sound:Play()
for i,bombs in pairs(script.Parent.Parent.Bombs:GetChildren()) do
bombs.BrickColor = BrickColor.new("New Yeller")
bombs.Material = Enum.Material.ForceField
bombs.Transparency = 1
end
wait(15)
door.Transparency = 0
door.CanCollide = true
newdoor:Destroy()
script.Parent.ProximityPrompt.Enabled = true
for i,bombs in pairs(script.Parent.Parent.Bombs:GetChildren()) do
bombs.BrickColor = BrickColor.new("New Yeller")
bombs.Material = Enum.Material.ForceField
bombs.Transparency = 0
end
script.Parent.Parent.Trigger2.Script.Disabled = false
script.Parent.Parent.Trigger2.ProximityPrompt.Enabled = true
db = true
end
end
end
end
end
end)

2 comments
The door is one big union that does not fall apart but is just one brick that falls out of it's place, i clone the door and it gets removed when the door respawns so it is fine if people push it.
ok