Merge pull request #5 from PiMonkeyServers/add_darkstick_cooldown

Add darkstick Cooldown
master
Xenon 2020-11-22 19:25:10 +01:00 committed by GitHub
commit 2ec44192c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -10,6 +10,7 @@ ________ _____ __________ ____ __. _________
--- Checking for translation
local S
local sleep = 0
if minetest.get_translator ~= nil then
S = minetest.get_translator(minetest.get_current_modname())
@ -161,6 +162,9 @@ minetest.register_tool("darks:darkstick", {
on_use = function(itemstack, player, pointed_thing)
if pointed_thing.above == nil then
return
end
if sleep == 7 then
return
end
minetest.add_particlespawner({
amount = 1000,
@ -176,8 +180,12 @@ minetest.register_tool("darks:darkstick", {
minsize = 5,
maxsize = 20,
texture = "darkness.png",
collisiondetection = false
collisiondetection = false,
minetest.after(7, function()
sleep = 0
end)
})
sleep = 7
end,
})