Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I fix this kill on event script?

Asked by 9 years ago
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?

0
Or just killing everyone would be fine too nightmare13542 45 — 9y

2 answers

Log in to vote
0
Answered by
exit16 20
9 years ago

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.

0
You did this on your question too. Please put the script in between blocks. :p nightmare13542 45 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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

Answer this question