slow player down while holding loaded rocket
This commit is contained in:
parent
6939ab0b6d
commit
0bdc630241
1 changed files with 18 additions and 1 deletions
|
@ -135,9 +135,26 @@ if shooter.config.enable_crafting == true then
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local timer = 0
|
||||||
|
minetest.register_globalstep(function(dtime)
|
||||||
|
timer = timer + dtime
|
||||||
|
if timer >= 0.1 then
|
||||||
|
for _, player in ipairs(minetest.get_connected_players()) do
|
||||||
|
local name = player and player:get_player_name()
|
||||||
|
local wielditem = player:get_wielded_item()
|
||||||
|
if wielditem:get_name() == "shooter_rocket:rocket_gun_loaded" then
|
||||||
|
local wielditem = player:get_wielded_item()
|
||||||
|
player:set_physics_override({
|
||||||
|
speed = 0.7
|
||||||
|
})
|
||||||
|
timer = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
--Backwards compatibility
|
--Backwards compatibility
|
||||||
minetest.register_alias("shooter:rocket", "shooter_rocket:rocket")
|
minetest.register_alias("shooter:rocket", "shooter_rocket:rocket")
|
||||||
minetest.register_alias("shooter:rocket_gun", "shooter_rocket:rocket_gun")
|
minetest.register_alias("shooter:rocket_gun", "shooter_rocket:rocket_gun")
|
||||||
minetest.register_alias("shooter:rocket_gun_loaded", "shooter_rocket:rocket_gun_loaded")
|
minetest.register_alias("shooter:rocket_gun_loaded", "shooter_rocket:rocket_gun_loaded")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue