anvils fall on you and tnt ignites at your position every10s

Post Reply
ph8jPf9M
Member
Posts: 77
Joined: Sat Jul 16, 2016 10:29
GitHub: 22i

anvils fall on you and tnt ignites at your position every10s

by ph8jPf9M » Post

tnt ignites and blows up at your position every 10 seconds https://youtu.be/tB36gC-IO0s?t=261
5x5 anvils falling at your position every 10 seconds https://youtu.be/tB36gC-IO0s?t=1349
How can this be done?

User avatar
AiTechEye
Member
Posts: 1000
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: anvils fall on you and tnt ignites at your position ever

by AiTechEye » Post

Attachments
stufffromsky.zip
(1.86 KiB) Downloaded 82 times

ph8jPf9M
Member
Posts: 77
Joined: Sat Jul 16, 2016 10:29
GitHub: 22i

Re: anvils fall on you and tnt ignites at your position ever

by ph8jPf9M » Post

this is perfect could you explain the code and document it.

User avatar
AiTechEye
Member
Posts: 1000
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: anvils fall on you and tnt ignites at your position ever

by AiTechEye » Post

listed mods in depends.txt make the we can use contents from them
init.lua its automacly runned by minetest engine
modpack.txt makes the minetest engine interpreters the folder as a folder with more mods


falling tnt:

loop in every systetick
_timer = timer + deltatime
__if timer is more then 10 then
__timer = 0
__counting players loop
___get player position
___position y = y + 5 (move the position 5 over the player)
___place tnt:tnt_burning (burning tnt)
__select next player, end loop
_end if timer
end loop


falling steel:

the loop:

loop in every systetick
_timer = timer + deltatime
_if timer is more then 10 then
__timer = 0
__counting players loop
___get player position
___position y = y + 20 (move the position 20 over the player)
___set steel entity 1
___set steel entity 2
___set steel entity 3
___set steel entity 4
___set steel entity 5
__end if timer
_select next player, end loop
end loop

steel entity:

on activate:
_set acceleration y=-8 (make it always falling down, kinda same speed as players)
_set velocity -2
end

on step:
_get object position
_counting all objects that are within the area
__get objects propertys, will be void if its a player
__if not objects propertys exist, and object name is not "fallingsteel:steel" then (make sure the object not is punching it self)
___punch object (50 hp)
__end of if
_end counting
_if object velocity y is 0 (check if the object not are falling) then
__place steelblock
__play steelblock dig sound
__remove object
_end of if


the type="" is just an extra variable, does nothing, but makes some mobs not attacking it

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests