[Mod] Sprint [sprint]

Re: [Mod] Sprint [sprint]

Postby texmex » Thu Jun 08, 2017 1:30 pm

I'm gonna try animated particles…
Image
texmex
Member
 
Posts: 1299
Joined: Mon Jul 11, 2016 9:08 pm
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint [sprint]

Postby LMD » Thu Jun 07, 2018 5:15 pm

Very basic requirement. However, not compatible with other speed potions etc, insert this code to change :
Code: Select all
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

Replace the original sprint function. Note : This interprets sprint as AMPLIFICATION, not as ADDITION! Thats a huge difference.
LMD
Member
 
Posts: 714
Joined: Sat Apr 08, 2017 8:16 am
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [Mod] Sprint [sprint]

Postby hexYeah » Sun Dec 16, 2018 4:03 pm

awesome thank you !
hexYeah
New member
 
Posts: 8
Joined: Wed Dec 12, 2018 2:09 am
In-game: hexYeah

Re: [Mod] Sprint [sprint]

Postby LMD » Sun Dec 16, 2018 9:43 pm

You're welcome !
LMD
Member
 
Posts: 714
Joined: Sat Apr 08, 2017 8:16 am
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo

Re: [Mod] Sprint [sprint]

Postby runs » Mon Apr 01, 2019 4:50 pm

Please, support for hudbars new version (1.0.0) and Minetest 5?
runs
Member
 
Posts: 389
Joined: Sat Oct 27, 2018 8:32 am
GitHub: runsy

Re: [Mod] Sprint [sprint]

Postby 305pink » Sat Apr 13, 2019 11:44 am

Does this work with V5.0?
305pink
Member
 
Posts: 35
Joined: Sun Apr 07, 2019 2:28 pm
In-game: Miami

Re: [Mod] Sprint [sprint]

Postby texmex » Sat Apr 13, 2019 11:59 am

Use hbSprint.

(It's not topic stealing if the mod is unmaintained :D)
texmex
Member
 
Posts: 1299
Joined: Mon Jul 11, 2016 9:08 pm
GitHub: tacotexmex
In-game: texmex



Return to Mod Releases



Who is online

Users browsing this forum: Bing Bot [Bot] and 0 guests