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

I keep infinitely going up slowly, why is my fly script not working?

Asked by 2 years ago

I have a fly script here in a Module script. I'm using Cmdr. Everything about the Cmdr and the module works, it's just the fly script that doesn't work. Here is my script:

return function (_, players)
    for _, player in pairs(players) do
        local char = player.Character
        local hum = char:WaitForChild("Humanoid")
        local Torso = char:WaitForChild("Torso")
        local Mouse = player:GetMouse()
        local debounce = false
        local BV = Instance.new("BodyVelocity",Torso)
        BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
        while debounce == true do
            BV.Velocity = Mouse.Hit.lookVector*100
            wait()
        end
    end

    return ( "%d players have been given the ability to fly."):format(#players)
end

Whenever I run the fly command I just start infinitely going up pretty slowly.

1 answer

Log in to vote
0
Answered by
SuperPuiu 497 Moderation Voter
2 years ago

You're using bodyforce at low velocity, try changing the velocity to a higher number.

0
What do you mean? the 100? I made it 10000 and nothing happened. Clooouudy 20 — 2y
0
Then try changing bodyforce to humanoidrootpart ? SuperPuiu 497 — 2y
0
Huh? Sorry, I'm pretty new to working with Bodyforces and stuff. Clooouudy 20 — 2y
0
I moved the BodyVelocity to the humanoid rootpart if that's what you mean. It still didn't work. Clooouudy 20 — 2y
View all comments (2 more)
0
Oh I'm sorry, it is pretty late for me and I can't think for an answer SuperPuiu 497 — 2y
0
Okay. Clooouudy 20 — 2y
Ad

Answer this question