|
| 04 May 2015 08:51 AM |
Is there a way how to make script count how many studs you drove. Oh and this is for taxi. I am building role play game.
*There is diff speed so you wont make script to add 1 stud every sec... |
|
|
| Report Abuse |
|
|
ganger800
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 427 |
|
|
| 04 May 2015 08:54 AM |
calculate the average speed after some time and then times the time :) you could do this with storing the speed every 0.25 seconds or something (this shouldn't lag too bad in small games) |
|
|
| Report Abuse |
|
|
|
| 04 May 2015 08:57 AM |
First, make a formula for the speed and then do
while wait(FORMULA) do --Add studs end |
|
|
| Report Abuse |
|
|
|
| 04 May 2015 09:00 AM |
| You mean formula: speed * time? |
|
|
| Report Abuse |
|
|
ganger800
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 427 |
|
|
| 04 May 2015 09:04 AM |
chickens idea is more efficient :)
how much speed equals 1 stud? thats why you need a formula |
|
|
| Report Abuse |
|
|
|
| 04 May 2015 09:07 AM |
| Can you tell me formula please? |
|
|
| Report Abuse |
|
|
|
| 04 May 2015 09:28 AM |
Look this is what I will use now:
local drivenstuds = 0
while wait(0.5) do drivenstuds = drivenstuds + ((script.Parent.Velocity.magnitude * 0.5) / 1000) wait() game.Workspace.Message.Text = drivenstuds end |
|
|
| Report Abuse |
|
|
| |
|