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

How can I make my BodyVelocity's MaxForce random?

Hi, is BodyVelocity's MaxForce can be added math.random() after the lookVector *? I wanted the MaxForce be random?

v.Velocity = char.HumanoidRootPart.CFrame.lookVector * 80

2 comments

0

v.Velocity = char.HumanoidRootPart.CFrame.lookVector * math.random(1, 80)

0

deleted post cos I gave a very dumb answer, didn't read the lookvector part

1 answer

Try this:

local maxSpeed = 90 -- set this to what you want
local minSpeed = 10 -- set this to what you want, but make it higher than 0
local bv = workspace.Bullet.BodyVelocity --Change this please, I don't know where the BodyVelocity is located
local char = player.Character -- Again, change this if needed
assert(maxSpeed >= minSpeed,"Max speed is lower than minSpeed")
v.Velocity = char.HumanoidRootPart.CFrame.lookVector * math.random(minSpeed,maxSpeed)

Change the variables to make this work, I honestly don't know where char or bv is located.

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