mirror of
https://github.com/LoneWolfHT/grenades.git
synced 2024-11-22 06:43:45 +01:00
Fix markdown
This commit is contained in:
parent
3e85df539a
commit
94f311b43f
42
api.md
42
api.md
@ -1,24 +1,26 @@
|
|||||||
#Grenades API
|
# Grenades API
|
||||||
|
|
||||||
Still WIP. Please suggest new features here: https://forum.minetest.net/viewtopic.php?f=9&t=21466
|
Still WIP. Please suggest new features here: https://forum.minetest.net/viewtopic.php?f=9&t=21466
|
||||||
|
|
||||||
##API
|
## API
|
||||||
|
|
||||||
grenades.register_grenade("name", { -- Name of the grenade (Like 'smoke' or 'flashbang')
|
```lua
|
||||||
description = "", -- A short description of the grenade.
|
grenades.register_grenade("name", { -- Name of the grenade (Like 'smoke' or 'flashbang')
|
||||||
image = "", -- The name of the grenade's texture
|
description = "", -- A short description of the grenade.
|
||||||
on_explode = function(pos, name)
|
image = "", -- The name of the grenade's texture
|
||||||
-- This function is called when the grenade 'explodes'
|
on_explode = function(pos, name)
|
||||||
-- <pos> the place the grenade 'exploded' at
|
-- This function is called when the grenade 'explodes'
|
||||||
-- <name> the name of the player that threw the grenade
|
-- <pos> the place the grenade 'exploded' at
|
||||||
end,
|
-- <name> the name of the player that threw the grenade
|
||||||
placeable = false, -- Optional, default is false
|
end,
|
||||||
clock = 3, -- Optional, controls how long until grenade detonates. Default is 3
|
placeable = false, -- Optional, default is false
|
||||||
particle = { -- Adds particles in the grenade's trail
|
clock = 3, -- Optional, controls how long until grenade detonates. Default is 3
|
||||||
image = "grenades_smoke.png", -- The particle's image
|
particle = { -- Adds particles in the grenade's trail
|
||||||
life = 1, -- How long (seconds) it takes for the particle to disappear
|
image = "grenades_smoke.png", -- The particle's image
|
||||||
size = 4, -- Size of the particle
|
life = 1, -- How long (seconds) it takes for the particle to disappear
|
||||||
glow = 0, -- Brightens the texture in darkness
|
size = 4, -- Size of the particle
|
||||||
interval = 5, -- How long it takes before a particle can be added
|
glow = 0, -- Brightens the texture in darkness
|
||||||
}
|
interval = 5, -- How long it takes before a particle can be added
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user