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

The velocity of the wheels isnt changing?

local Wheel1 = script.Parent.Wheels.FL
local wheel2 = script.Parent.Wheels.FR
local Wheel3 = script.Parent.Wheels.RL
local Wheel4 = script.Parent.Wheels.RR
local rep = game.ReplicatedStorage
local Vel = Wheel1.Velocity
local Vel2 = wheel2.Velocity
local Vel3 = Wheel3.Velocity
local Vel4 = Wheel4.Velocity

rep.V.OnServerEvent:Connect(function(player)
	local SpeedPerStud = 1
	local character1 = player.Character
	local LastPosition = character1.HumanoidRootPart.Position
	local DistanceFromLastPosition = (character1.HumanoidRootPart.Position-LastPosition).magnitude
	Vel = Vel+(DistanceFromLastPosition+SpeedPerStud)
	local LastPosition = character1.HumanoidRootPart.Position
	print("works") -- this prints
end)

3 comments

0

any errors?

0

what type of velocity is it?

0

No there is no errors and i am not sure i just typed in velocity

1 answer

✓ Accepted answer

ok 3 problems...

  1. Velocities have 3 vectors, and it goes in that direction relative to the world i think. so trying to do
 Vel = Vel+(DistanceFromLastPosition+SpeedPerStud)

wont work, distance fromlast position is one number, and vector 3s have 3 values

  1. To change a velocity, you need its velocity property, so to change it, you gotta do
VelocityName.Velocity = a Vector3
  1. when you declare last position at the beginning, it doesnt do anything, its the same as calling the normal position because it happens at the same time almost cause scripts are fast, so distancefromalast position is actually 0, or close to it. I dont understand exactly what your trying to do so i cant make a script but i jsut want you to know these things so you can fix your code if you need.

i hope this helps :>

2 comments

1

THANK YOU cutie ;)

0

thx ',:3

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