[SOLVED] How do you count down that a player is capturing something?
-
- Member
- Posts: 117
- Joined: Sat May 28, 2022 00:04
[SOLVED] How do you count down that a player is capturing something?
My project has objects that need to be captured by players, however there is a cooldown timer that goes on for if a player is an enemy of the other team. If they are, then they will be able to capture the object after about 7.5 seconds. I could use minetest.after but what if the player moves away from the capture positions? How do I reset the timer or boolean to start timer if a player is not found at locations for capture? Whoever helps will be credited in my project.
Last edited by ChristienChapman on Thu Jul 14, 2022 00:33, edited 1 time in total.
God bless you.
List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633
- > cdb_1d60e1a03f83
List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633
- > cdb_1d60e1a03f83
Re: How do you count down that a player is capturing something?
minetest.after() returns an object that has a method cancel() that you can call to cancel the timer.
For example:
local job = minetest.after(1, my_event)
job:cencel()
For example:
local job = minetest.after(1, my_event)
job:cencel()
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II
-
- Member
- Posts: 117
- Joined: Sat May 28, 2022 00:04
Re: How do you count down that a player is capturing something?
Wow thanks. This would have been great for a project I was working on but I recently cancelled it! Still great advice nonetheless thanks.
God bless you.
List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633
- > cdb_1d60e1a03f83
List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633
- > cdb_1d60e1a03f83
Who is online
Users browsing this forum: Ahrefs [Bot] and 9 guests