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

How can I make my BodyVelocity's MaxForce random?

Asked by 5 years ago

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
0
v.Velocity = char.HumanoidRootPart.CFrame.lookVector * math.random(1, 80) User#19524 175 — 5y
0
deleted post cos I gave a very dumb answer, didn't read the lookvector part Elixcore 1337 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

Ad

Answer this question