Here's a basic Lua script you can use in Roblox Studio to simulate a nuke explosion when activated. The script involves a Part (the "Nuke") that, once interacted with, creates an explosion effect, deals damage to nearby players, and adds visual and sound effects.
🔥 Step-by-Step: Setting Up the Nuke in Roblox Studio
🎯 Prerequisites:
- Add a Part in the workspace (name it:
Nuke).
- Add a ClickDetector inside the Nuke part (for activation by player click).
- Add a Script inside the Nuke part (not a LocalScript — a regular Script).
✅ Complete Script for the Nuke (Script inside the Nuke)
-- Get references
local nuke = script.Parent
local clickDetector = nuke:FindFirstChild("ClickDetector")
-- Explosion Configuration
local EXPLOSION_RADIUS = 100
local EXPLOSION_DAMAGE = 100
local EXPLOSION_DELAY = 3 -- seconds before the nuke detonates
-- Sound Effect Setup (optional)
local boomSound = Instance.new("Sound", nuke)
boomSound.SoundId = "rbxassetid://138186576" -- Replace with your preferred nuke sound
boomSound.Volume = 10
boomSound.Looped = false
-- Explosion Function
local function explode()
-- ⚠ Flash Effect (optional)
local flash = Instance.new("Part")
flash.Size = Vector3.new(1000, 1000, 1000)
flash.Anchored = true
flash.CanCollide = false
flash.Transparency = 0.7
flash.BrickColor = BrickColor.new("Institutional white")
flash.Material = Enum.Material.Neon
flash.Position = nuke.Position
flash.Parent = workspace
game:GetService("Debris"):AddItem(flash, 0.2)
-- 💥 Explosion Visual
local explosion = Instance.new("Explosion")
explosion.Position = nuke.Position
explosion.BlastRadius = EXPLOSION_RADIUS
explosion.BlastPressure = 500000
explosion.ExplosionType = Enum.ExplosionType.NoCraters
explosion.Parent = workspace
-- 💀 Damage Players
explosion.Hit:Connect(function(part)
local character = part:FindFirstAncestorOfClass("Model")
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:TakeDamage(EXPLOSION_DAMAGE)
end
end)
boomSound:Play()
-- 💨 Mushroom Cloud Effect (optional)
local smoke = Instance.new("Smoke", nuke)
smoke.Size = 100
smoke.Opacity = 0.8
smoke.RiseVelocity = 5
smoke.Color = Color3.fromRGB(50, 50, 50)
game:GetService("Debris"):AddItem(smoke, 10)
-- 💣 Destroy the nuke part after detonation
wait(1)
nuke:Destroy()
end
-- Activate Nuke
local function activateNuke()
print("[NUKE] Activated. Detonating in " .. EXPLOSION_DELAY .. " seconds.")
-- Countdown visual (optional)
for i = EXPLOSION_DELAY, 1, -1 do
nuke.BrickColor = BrickColor.Red()
wait(0.2)
nuke.BrickColor = BrickColor.Gray()
wait(0.8)
end
explode()
end
-- Listen for click
clickDetector.MouseClick:Connect(function(player)
activateNuke()
end)
🎨 Tips for Customization:
- Change
blast radius, damage, and explosion delay values for different effects.
- Add a UI warning system to alert all players before detonating.
- Use ParticleEmitters, custom mesh models, or Cinematics for EPIC visuals.
⚠️ Safety Note:
Roblox strongly discourages grief-style scripts and uncontrolled explosions in public experiences. Use this nuke script for confined or comedic purposes, and preferably in private, sandbox-style games.
Let me know if you'd like:
- A version triggered by ProximityPrompt
- A cutscene-style cinematic nuke
- Multiplayer warnings or radio/chat-style alerts
💣 Boom responsibly!