Add effects for ecigarettes
This commit is contained in:
parent
3d47d08dc4
commit
3d2f45d1fd
15
init.lua
15
init.lua
@ -1,7 +1,20 @@
|
||||
playereffects.register_effect_type("cigarettespeed", "Cigarette Speed", "ecigarettes_ecigarette.png", {"speed"},
|
||||
function(player)
|
||||
player:set_physics_override({speed=3})
|
||||
end,
|
||||
function(effect, player)
|
||||
player:set_physics_override({speed=1})
|
||||
end
|
||||
)
|
||||
|
||||
minetest.register_tool("ecigarettes:ecigarette", {
|
||||
description = "E-Cigarette",
|
||||
inventory_image = "ecigarettes_ecigarette.png",
|
||||
on_use = minetest.item_eat(10),
|
||||
on_use = function(itemstack, player, pointed_thing)
|
||||
playereffects.apply_effect_type("cigarettespeed", 190, player)
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craftitem("ecigarettes:eliquid", {
|
||||
|
Loading…
x
Reference in New Issue
Block a user