if so then you need created your own system explosion with whatever-casts (recommeding using workspace to fire the Method, doesn’t need Instance.new())
if you want constenst explosion, fire the SphereCast alot (in different position(-s), if you want bombarding) because it’s fired
make sure part are touched by SphereCast, not intersected
What a hassle just for dropping a bomb on someone’s head.
I can see why you ran into issues.
Module
--ModuleScript in ReplicatedStorage named NukeModule
local Nuke={}
function Nuke.Spawn(targetPos, ignorePlayer)
local n=Instance.new("Part")
n.Size=Vector3.new(4,4,4)
n.Position=targetPos+Vector3.new(0,500,0)
n.Anchored=true
n.CanCollide=false
n.Shape=Enum.PartType.Ball
n.BrickColor=BrickColor.new("Really red")
n.Material=Enum.Material.Neon
n.Parent=workspace
task.spawn(function()
local speed=0
while n.Position.Y > targetPos.Y do
local dt=task.wait()
speed=speed+9.81*dt*5
n.Position=n.Position-Vector3.new(0,speed*dt,0)
end
local explosion=Instance.new("Explosion")
explosion.Position=n.Position
explosion.BlastRadius=50
explosion.BlastPressure=200000
explosion.ExplosionType=Enum.ExplosionType.NoCraters
explosion.Parent=workspace
explosion.Hit:Connect(function(p)
if ignorePlayer and p:IsDescendantOf(ignorePlayer.Character) then return end
local h=p:FindFirstAncestorOfClass("Model") and p:FindFirstAncestorOfClass("Model"):FindFirstChildOfClass("Humanoid")
if h then h:TakeDamage(100) end
end)
task.spawn(function()
task.wait(1)
explosion:Destroy()
n:Destroy()
end)
end)
end
return Nuke
A way to trigger it to test with
ServerScript
--ServerScript in ServerScriptService
local ReplicatedStorage=game:GetService("ReplicatedStorage")
local ev=ReplicatedStorage:FindFirstChild("NukeEvent") or Instance.new("RemoteEvent",ReplicatedStorage)
ev.Name="NukeEvent"
local Nuke=require(ReplicatedStorage:WaitForChild("NukeModule"))
ev.OnServerEvent:Connect(function(player,targetPos)
Nuke.Spawn(targetPos, player)
end)
LocalScript
--LocalScript in StarterPlayerScripts
local ReplicatedStorage=game:GetService("ReplicatedStorage")
local UserInputService=game:GetService("UserInputService")
local ev=ReplicatedStorage:WaitForChild("NukeEvent")
local player=game.Players.LocalPlayer
UserInputService.InputBegan:Connect(function(i,processed)
if processed then return end
if i.KeyCode==Enum.KeyCode.E then
local pos=player.Character and player.Character.PrimaryPart and player.Character.PrimaryPart.Position or Vector3.new()
ev:FireServer(pos)
end
end)
Had it working right away, but I could not get rid of the engine flashing that red bar to indicate potential high-impact damage or network stress. Finally, I got it working.
I’ve never even seen that until now. Nuke blues I guess.
Pretty sure the whole area is going to go up in flames.
May be a whole lot of overkill here.