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)
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
2) To change a velocity, you need its velocity property, so to change it, you gotta do
VelocityName.Velocity = a Vector3
3) 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 :>