Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to use magnitude properly?

This script isn't working, could someone please tell me what I'm doing wrong?

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		char.HumanoidRootPart:GetPropertyChangedSignal("Position"):Connect(function()
		if (script.Parent.Position - char.HumanoidRootPart.Position).magnitude < 5 then
			script.Parent:Destroy()
		end
		end)
	end)
end)

Thanks!

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.