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

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

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

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

6 comments

0

What do you mean? the 100? I made it 10000 and nothing happened.

0

Then try changing bodyforce to humanoidrootpart ?

0

Huh? Sorry, I'm pretty new to working with Bodyforces and stuff.

0

I moved the BodyVelocity to the humanoid rootpart if that's what you mean. It still didn't work.

0

Oh I'm sorry, it is pretty late for me and I can't think for an answer

0

Okay.

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