I'm gonna try animated particles…
local function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting)
local player = minetest.get_player_by_name(playerName)
if players[playerName] then
local physics=player:get_physics_override()
local was_sprinting=players[playerName]["sprinting"]
players[playerName]["sprinting"] = sprinting
if sprinting == true then
if not was_sprinting then
player:set_physics_override({speed=physics["speed"]*SPRINT_SPEED,jump=physics["jump"]*SPRINT_JUMP})
end
elseif sprinting == false then
if was_sprinting then
player:set_physics_override({speed=physics.speed/SPRINT_SPEED,jump=physics.jump/SPRINT_JUMP})
end
end
return true
end
return false
end
Users browsing this forum: Bing Bot [Bot] and 0 guests