Hello, I know that I'm close to solving magnitude but I don't understand how to fix this (If player is within 10 studs of brick in Workspace, kill them.):
local a = game.Workspace.P1
game.Players.ChildAdded:connect(function(Player)
if Player then
if game.Workspace:FindFirstChild(Player.Name) then
local Char = Player.Character
local Tors = Char:WaitForChild("Torso")
while true do
if (a.Position - Tors.Position).magnitude < 10 then
Char:BreakJoints()
wait(.01)
end
wait(.01)
end
end
end
end)
