I keep getting this error, attempt to index number with 'LineVelocity'
, upon reaching the max speed (30 in this case), works perfectly fine up until then
UIS.InputBegan:Connect(function(input, isTyping)
if not isTyping then
if input.KeyCode == Enum.KeyCode.W then
if not Pressed then
Pressed = true
repeat task.wait(1/Acceleration.Value)
if Velocity.LineVelocity >= MaxSpeed.Value then
Velocity = MaxSpeed.Value
elseif Velocity.LineVelocity < MaxSpeed.Value then
Velocity.LineVelocity += 1
end
until not Pressed
end
end
end
end)
I’ve tried adding tonumbers, changing the format of it and nothing has worked so far.