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

1 comment
None of the script is working as in the building isn't getting unanchored and there is no explosion I don't know why