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

Why isnt this code changing the velocity of the wheels?

Asked by
Il_5x5 10
3 years ago
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)

Answer this question