diff options
Diffstat (limited to 'res/scripts/common.lua')
| -rw-r--r-- | res/scripts/common.lua | 14 |
1 files changed, 14 insertions, 0 deletions
| diff --git a/res/scripts/common.lua b/res/scripts/common.lua index e95f6f1..895ad7b 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
| @@ -315,3 +315,17 @@ function StopClipping() | |||
| 315 | local playerSprite = getSprite(playerId) | 315 | local playerSprite = getSprite(playerId) |
| 316 | playerSprite.clipping = false | 316 | playerSprite.clipping = false |
| 317 | end | 317 | end |
| 318 | |||
| 319 | --- Turns off crouching (and thus running) for the player. | ||
| 320 | function PreventCrouching() | ||
| 321 | local playerId = getPlayerSprite() | ||
| 322 | local playerSprite = getSprite(playerId) | ||
| 323 | playerSprite.cantCrouch = true | ||
| 324 | end | ||
| 325 | |||
| 326 | --- Undoes the effect of PreventCrouching(). | ||
| 327 | function AllowCrouching() | ||
| 328 | local playerId = getPlayerSprite() | ||
| 329 | local playerSprite = getSprite(playerId) | ||
| 330 | playerSprite.cantCrouch = false | ||
| 331 | end | ||
