Matthais5
|
  |
| Joined: 19 Apr 2012 |
| Total Posts: 6520 |
|
|
| 21 Mar 2016 12:59 PM |
Something like while the player is standing on a brick, he/she gets extra movespeed, but ONLY WHILE they're standing on the brick. The moment they step off the brick they lose the movespeed boost.
I know there's a way to do it by constantly checking the player's CFrame, but that requires a while true loop which seems terribly inefficient.
The only thing I can think of is making a ring around the part with its own onTouched script that reverts a player back to 16 walkspeed the moment he/she touches the ring. This doesn't seem terribly inefficient, but it also doesn't seem ideal (there seems to be many ways it could go wrong).
Thoughts? Ideas? |
|
|
| Report Abuse |
|
|
| 22 Mar 2016 05:01 PM |
script.Parent.Touched:connect(funtion(hit) hit.Parent.Humanoid.WalkSpeed = AMOUNT End
script.Parent.TouchEnd:connect(function(hit) Hit.Parent.Humanoid.WalkSpeed = 16 end
They might be wrong with some bugs.. |
|
|
| Report Abuse |
|
belial52
|
  |
| Joined: 10 Oct 2009 |
| Total Posts: 8074 |
|
|
| 22 Mar 2016 05:02 PM |
| Do a region3 above the part and check if they're in it. |
|
|
| Report Abuse |
|