50% found this document useful (2 votes)
479 views3 pages

Roblox Nuke Countdown Script

Uploaded by

Daniel Carvalho
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
479 views3 pages

Roblox Nuke Countdown Script

Uploaded by

Daniel Carvalho
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local Workspace = game:GetService("Workspace")

local Players = game:GetService("Players")


local Debris = game:GetService("Debris")

-- Settings
local NUKE_COUNT = 60
local COUNTDOWN_TIME = 5
local RANGE = 100
local MIN_HEIGHT = 150
local MAX_HEIGHT = 300

local EXPLOSION_SOUND_ID = "rbxassetid://138186576" -- boom


local SIREN_SOUND_ID = "rbxassetid://9118823109" -- warning siren (change if
needed)

-- Function: camera shake for nearby players


local function shakeCamera(position)
for _, player in pairs(Players:GetPlayers()) do
local char = [Link]
if char and char:FindFirstChild("HumanoidRootPart") then
local dist = ([Link] -
position).Magnitude
if dist < 80 then
local cam = [Link]
local event = [Link]("BindableEvent")
[Link]:Connect(function()
local cam = [Link]
local shakePower = [Link](5 - (dist / 20), 1, 5)
local shakeTime = 0.3
local start = tick()
while tick() - start < shakeTime do
local offset = [Link](
[Link](-shakePower, shakePower) /
10,
[Link](-shakePower, shakePower) /
10,
[Link](-shakePower, shakePower) / 10
)
[Link] = [Link] * [Link](offset)
wait(0.03)
end
end)
event:Fire()
event:Destroy()
end
end
end
end

-- Function: create a falling nuke


local function spawnNuke(position)
local nuke = [Link]("Part")
[Link] = [Link](4, 8, 4)
[Link] = [Link]("Really red")
[Link] = [Link]
[Link] = false
[Link] = true
[Link] = position
[Link] = "FallingNuke"

local smoke = [Link]("Smoke")


[Link] = 10
[Link] = 5
[Link] = nuke

[Link]:Connect(function(hit)
if not nuke or not [Link] then return end

local explosion = [Link]("Explosion")


[Link] = 25
[Link] = 1000000
[Link] = [Link]
[Link] = Workspace

-- Fire
for i = 1, 5 do
local fire = [Link]("Fire")
[Link] = 15
[Link] = 10
local firePart = [Link]("Part")
[Link] = true
[Link] = false
[Link] = 1
[Link] = [Link] + [Link]([Link](-5,
5), 0, [Link](-5, 5))
[Link] = firePart
[Link] = Workspace
Debris:AddItem(firePart, 5)
end

-- Explosion sound
local boom = [Link]("Sound", Workspace)
[Link] = EXPLOSION_SOUND_ID
[Link] = 2
[Link] = [Link]
boom:Play()
Debris:AddItem(boom, 5)

shakeCamera([Link])
nuke:Destroy()
end)

[Link] = Workspace
end

-- Function: display 3D countdown above center


local function showCountdown(seconds)
local part = [Link]("Part")
[Link] = true
[Link] = false
[Link] = 1
[Link] = [Link](0, 60, 0)
[Link] = [Link](1, 1, 1)
[Link] = "CountdownDisplay"

local billboard = [Link]("BillboardGui", part)


[Link] = [Link](0, 200, 0, 100)
[Link] = true

local label = [Link]("TextLabel", billboard)


[Link] = [Link](1, 0, 1, 0)
[Link] = 1
label.TextColor3 = [Link](1, 0, 0)
[Link] = true
[Link] = [Link]
[Link] = "Nukes Inbound..."

[Link] = Workspace

for i = seconds, 0, -1 do
[Link] = "NUKES INCOMING IN: " .. i
wait(1)
end

part:Destroy()
end

-- Function: play siren


local function playSiren()
local siren = [Link]("Sound", Workspace)
[Link] = SIREN_SOUND_ID
[Link] = 2
[Link] = false
siren:Play()
Debris:AddItem(siren, 10)
end

-- 🚨 Start: Countdown & Siren


playSiren()
showCountdown(COUNTDOWN_TIME)

-- 💣 Spawn 60 falling nukes after countdown


for i = 1, NUKE_COUNT do
local x = [Link](-RANGE, RANGE)
local z = [Link](-RANGE, RANGE)
local y = [Link](MIN_HEIGHT, MAX_HEIGHT)
spawnNuke([Link](x, y, z))
wait(0.1)

end

You might also like