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

Why that part of tool gravity script dont delete body force when unequipped?

Asked by 2 years ago
Edited 2 years ago

The script:

    script.Parent.Unequipped:Connect(function()

        local char = script.Parent.Parent.Parent.Character

        local root = char:FindFirstChild("HumanoidRootPart")

        if root:FindFirstChild("BodyForce") then
            root["BodyForce"]:Destroy()
        end

        for i,v in pairs(script.Parent.Parent:GetDescendants()) do
            if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
                v.Massless = false
            end
        end

    end)

Answer this question