children = game.Players:GetChildren()
if script.Parent.Anchored == true then
children:remove()
end
How would I make it so that when the brick is no longer anchored it will kill everyone within a certain radius?
children = game.Players:GetChildren()
if script.Parent.Anchored == true then
children:remove()
end
How would I make it so that when the brick is no longer anchored it will kill everyone within a certain radius?
So first you must define whether a humanoid is there or not so maybe this might help VVV. local Player = script.Parent:FindFirstChild("Humanoid") if (Humanoid ~=nil) then do
I think the "Script.Parent:FindFirstChild" bit was a bit of track so maybe define where you would find the humanoid in example Part,GUI etc. I hope that worked. Try using the "if (Humanoid ~=nil) then do" thing because ~ means does not. And = means equals. So that means does not equal. And nil means 0 so that means if the humanoid does not equal nothing, which means if the humanoid is there then do a script.
You did this on your question too. Please put the script in between blocks. :p
You're removing the Players, wich would Kick them from the server, not kill them. Try this instead:
while true do -- Make it loop so it keeps checking. Without this it will only check once.
wait()
if script.Parent.Anchored == false then -- You had it on true, wich will kill the players when the brick IS anchored. False is when the brick is NOT anchored
for i,v in ipairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Or just killing everyone would be fine too