of     1   

TheDragonFish
#140980086Sunday, July 20, 2014 8:48 PM GMT

So I have a script that subtracts two vector3 positions to get the amount of studs between point A and point B. How do I change the Vector3 coordinate that prints to a single number. Script: while true do A = game.Workspace.Car.something.Position wait(1) B = game.Workspace.Car.something.Position Speed = A - B print(Speed) end
TheDragonFish
#140980735Sunday, July 20, 2014 8:55 PM GMT

Bump
TheDragonFish
#140981675Sunday, July 20, 2014 9:05 PM GMT

cmon ppls
TheDragonFish
#140982676Sunday, July 20, 2014 9:16 PM GMT

i need help pls --Who needs signatures--
cntkillme
#140982901Sunday, July 20, 2014 9:18 PM GMT

You could just get the Magnitude of the Velocity, but in your case just do print(Speed.Magnitude)
blockoo
#140983383Sunday, July 20, 2014 9:23 PM GMT

Using .magnitude: while true do A = game.Workspace.Car.something.Position wait(1) B = game.Workspace.Car.something.Position Speed = (B - A).magnitude if (Speed < 0) then Speed = Speed * -1 end print(Speed) end I would also suggest reducing the wait time. A speedometer that only updates once per second doesn't seem too useful.
TheDragonFish
#140987666Sunday, July 20, 2014 10:07 PM GMT

I am going to make it every .01 seconds and then just multiply by 100. Also I have another question. How do I make it where you can be in first person in a vehicleSeat?
bibo5o
#140988862Sunday, July 20, 2014 10:19 PM GMT

source --https://scriptinghelpers.org/questions/5/how-do-i-force-first-person-mode Put this in a Touched() function player.CamerMode = Enum.CameraMode.LockFirstPerson When they get off I think there is a connectionEnded() event as well, not sure. player.CameraMode = Enum.CameraMode.Classic
cntkillme
#140989652Sunday, July 20, 2014 10:28 PM GMT

Seat.ChildAdded event
blockoo
#140990052Sunday, July 20, 2014 10:33 PM GMT

A weld object is created and parented to the seat when a player sits in it. The weld disappears when the player leaves the seat. Using ChildAdded (as said above) you can do what you need. Also, for forcing first person: game.Players.Player.CameraType = "LockFirstPerson"
TheDragonFish
#141002390Monday, July 21, 2014 12:42 AM GMT

Ok so how do I round the speed? Theres like a million digits.
TheDragonFish
#141002573Monday, July 21, 2014 12:44 AM GMT

In other words how do I round?
blockoo
#141003290Monday, July 21, 2014 12:52 AM GMT

An easy way to round would be to just use math.floor(num) on the number which will basically just get rid of all the decimals without really rounding. Do you want the speed to just be whole numbers, or do you want some decimals?

    of     1