Guest User

Untitled

a guest
Apr 10th, 2013
39
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function MG(NAME, DESC, IMG, speed, jump, gravity)
  2. minetest.register_craftitem(NAME, {
  3. description = DESC,
  4. inventory_image = IMG,
  5. })
  6.  
  7. minetest.register_on_joinplayer(function(player)
  8. local wielded_item = player:get_wielded_item():get_name()
  9. end)
  10.  
  11. minetest.register_globalstep(function(dtime)
  12. local wielded_item = player:get_wielded_item():get_name()
  13. if wielded_item == NAME then
  14. -- 1 is default when defining the function below set everything you dont want to chnage to 1.
  15. -- The numbers are ratios compared to the default setting. 1=def, 2=2x, .5=1/2, and so on...
  16. set_physics_override(speed, jump, gravity)
  17. end
  18. end)
  19. end
  20.  
  21. MG("magic:low_G", "Low Gravity", "magic_lg.png", 1, 1, .5)
  22. MG("magic:high_S", "High Speed", "magic_hs.png", 2, 1, 1)
  23. MG("magic:high_J", "High Jump", "magic_hj.png", 1, 2, 1)
  24. MG("magic:ninja", "Ninja Powers", "ninja_star.png", 2.5, 1.5, 1)
RAW Paste Data