-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spike bushes #5
Comments
minetest.register_node (name..":bush", {
description = "Spike bush",
tiles = {"spiky_bush.png"},
drawtype = "plantlike",
groups = {cracky=1},
walkable =false,
on_timer = function(pos)
local objs = minetest.get_objects_inside_radius(pos, 0.8)
for _, player in pairs(objs) do
local hp = player:get_hp ()
if player:is_player() then
if hp > 0 then
player:set_hp(hp-1)
end
break
end
end
return true
end,
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(0.6)
end,
}) Code for spiky bush hurts faster than normal inside block damage |
No need for node timers. It's much better to directly add damage. :) |
Have you given it a try yet? |
It's just that it's inefficient to run nodetimers without any purpose. You only need:
(as an example. I might make the damage 2 or 3 instead) |
OK but the point was that it hurts faster |
Code I've added to the main game version:
You can't walk through without taking damage. This is the whole point of (I may make further adjustments to groups, especially once we finish tools.) |
No what I was saying is that sometimes ppl can get through the block faster than 1 second Like I've managed to fall into lava and get out again without getting damaged |
It's immediate. It doesn't fire after one second. |
There should be painful things to stumble into in the dark.
The text was updated successfully, but these errors were encountered: