|
| 10 Oct 2014 04:06 PM |
| Is it possible to make a script that counts how many steps you take? |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Oct 2014 04:46 PM |
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Running
Speed = studs per second |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 10 Oct 2014 04:49 PM |
| You could also check the total distance travelled using an inefficient loop, but that wouldn't count just steps (Would include falling, flinging, driving, etc) so I'll leave that out unless you want it. |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2014 05:13 PM |
| I must be really stupid because I still haven't figured this out. Help? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Oct 2014 05:25 PM |
128 pretty much gave you the answer.
something like ..
local numofsteps = 0
while wait(1) do local newnum = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed numofsteps = numofsteps + newnum print(tostring(numofsteps)) end
[[Extremely inefficient lol]]
|
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Oct 2014 06:09 PM |
This could be cleaned up, but after testing, the running event itself only fires when the player starts running, if you pick up speed, the speed change is not counted
Like I said, could be cleaner, but does work.
local player = game.Players.LocalPlayer local character = player.Character if not character then character = player.CharacterAdded:wait() end
local stopped, steps = true, 0 character.Humanoid.Running:connect(function(speed) stopped = (speed == 0) repeat steps = steps + character.Torso.Velocity.magnitude / 10 wait(0.1) until stopped print(steps) end) |
|
|
| Report Abuse |
|
|