Hi! Thanks for viewing! I've currently taken to Lua scripting, and i'm following a scripting guide, See here http://www.roblox.com/Forum/ShowPost.aspx?PostID=37553216 I'm currently on the second step. I know how to call the function, but how would I make it get all the players in a certain radius? after that I'm pretty sure I could make it kill everyone. Thanks for any and all help!
(Scripting Student) How would I make a nuclear bomb script work? (NOT SOLVED)
2 answers
There are others way but you could create a large invisible block that if onTouched would kill them.
2 comments
The tutorial says I have to make it spread and use :BreakJoints, and I would feel as if I were cheating doing that. Thank you though.
If you needed to do that. You could use a wait and a line that re-sizes such as wait(2) Part.Size = ("5, 5, 5")
local originPart = game.Workspace.Part
local radius = 100
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
end
end
end
end
originPart is the origin of the bomb, in the form of a part. radius is the radius length in studs.
Line 8 checks if the model in the Workspace is a player.
Line 9 uses Magnitude to check the distance between the originPart and the Head of the player to see if it is less than or equal to the value of the radius variable.
Line 10 kills the player.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Increase the blast Radius