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!
There are others way but you could create a large invisible block that if onTouched would kill them.
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.