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

Why won't my player move while they have the parachute?

Asked by 6 years ago
Edited 6 years ago

This script creates a parachute when the player joins and they float down to the baseplate. It works perfectly, but I can't move around while I'm falling. How do I fix this?

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)

        -- create the parachute
        local Parachute = Instance.new("Part", char.Torso)
        Parachute.Size = Vector3.new(2, 1, 2)
        Parachute.CanCollide = false

        local RealParachute = Instance.new("Part", char.Torso)
        RealParachute.Transparency = 1
        RealParachute.CanCollide = false

        -- parachute mesh
        local Mesh = Instance.new("SpecialMesh", Parachute)
        Mesh.MeshId = "http://www.roblox.com/asset/?id=85027689"
        Mesh.TextureId = "http://www.roblox.com/asset/?id=85027535"
        Mesh.Scale = Vector3.new(1,1,1)

        local Parachute_Decal = Instance.new("Decal", Parachute)
        Parachute_Decal.Texture = "http://www.roblox.com/asset/?id=18051314"

        local BodyVelocity2 = Instance.new("BodyVelocity", Parachute)
        BodyVelocity2.Velocity = Vector3.new(0, -20, 0)

        local BodyVelocity = Instance.new("BodyVelocity", RealParachute)
        BodyVelocity.Velocity = Vector3.new(0, 100000, 0)

        -- parachute welds
        local s = Instance.new("Weld") -- Real parachute weld
        s.Parent = char
        s.Part0 = RealParachute
        s.Part1 = Parachute
        s.C0 = CFrame.new(0, -15, 2)

        local w = Instance.new("Weld") 
        w.Parent = char
        w.Part0 = Parachute
        w.Part1 = char.Torso
        w.C0 = CFrame.new(0, 0, -1)

-- parachute's position 

    while true do
            local GroundLevel = (Parachute.Position - game.Workspace.Baseplate.Position).Magnitude
            print(math.floor(GroundLevel))

            local floor = math.floor(GroundLevel)

            if floor == 12 then
                print("STOP")
                RealParachute:Destroy()
                Parachute:Destroy()
            end
            wait(2)

        end

    end)
end)

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

It looks like you weld the parachute to the character and then give it BodyVelocity. This makes it a part of the character's system, moving character too.

It might be best to simply use a BodyForce to partially counter gravity.

Another option is to set the MaxForce of BodyVelocity to Vector3.new(0,[number],0) so only the Y axis is affected.

Ad

Answer this question