I am trying to make a script where a nuke explodes and then the building changes to a destroyed version but neither scripts are working for me. Here's the script:
game.Workspace.Nuke.Transparency = 0 game.Workspace.Nuke.CanCollide = true local originPart = game.Workspace.Nuke local radius = 1000 function killFromOrigin() for i,v in pairs (game.Workspace:GetChildren()) do local humanoid = v:FindFirstChild("Humanoid") local head = v:FindFirstChild("Head") if head ~= nil and humanoid ~= nil then if (originPart.Position - head.Position).Magnitude <= radius then humanoid.Health = 0 game.Workspace.ReactorCore1:Destroy() local map = game.ServerStorage.ReactorCore2 map:Clone().Parent = game.Workspace end end end end
You may try making an explosion and un anchoring every part at the time of the explosion.
local children = game.Workspace:GetChildren()--Unanchor children for i = if children:IsA("Part") then i.Anchored = false end local explosion = Instance.new("Explosion")--Create the explosion. explosion.BlastRadius = 99999999999--Enoughly big to affect the entire nuke plant. explosion.BlastPressure = 999999999999--Enoughly big to make fly even the biggest parts. explosion.Position = Vector3.new(--Nuke.Position)