Check For Sprinting In All Directions
parent
1fee02cf32
commit
9edc6e1f3e
4
init.lua
4
init.lua
|
@ -11,8 +11,10 @@ minetest.register_globalstep(function(dtime)
|
|||
local privs = minetest.get_player_privs(name)
|
||||
local old_breath = player:get_attribute("old_breath") or 11
|
||||
local sprint_time = player:get_attribute("sprint_time") or 0
|
||||
local controls = player:get_player_control()
|
||||
|
||||
if player:get_player_control()["aux1"] and player:get_player_control()["up"] and privs.fast then
|
||||
if controls["aux1"] and
|
||||
( controls["up"] or controls["down"] or controls["left"] or controls["right"] ) and privs.fast then
|
||||
sprint_time = sprint_time + timer
|
||||
|
||||
breath = old_breath - ( sprint_time * (11 / sprint_length) )
|
||||
|
|
Loading…
Reference in New Issue