So I have a command computer that starts a countdown timer when a student hits a button and sends out a redstone signal when the timer goes down to 0. It also sends messages to students with the tell command.
I think I want to step it up a notch, though, and I need some lua help for this. Students activate the countdown on the command computer with the press of a button and a redstone signal to the computer. My goal here is to stop the countdown if there are no students within a certain radius of the computer AND allow the program to reset itself automatically so the students can attempt to press the button again at a later time.
Please keep in mind that because of Microsoft I am stuck in MinecraftEDU version 1.7.10 stable build 20 and I am using computercraftedu and Craft OS 1.7
Also my coding skills are very basic...
command.exec and testfor question
Started by hawkins627, Mar 30 2017 02:17 PM
3 replies to this topic
#1
Posted 30 March 2017 - 02:17 PM
#2
Posted 30 March 2017 - 05:56 PM
try using "testfor @a[r=radius]"
Eg:
testfor @a[r=5]
Eg:
testfor @a[r=5]
#3
Posted 31 March 2017 - 02:49 PM
TheRockettek, on 30 March 2017 - 05:56 PM, said:
try using "testfor @a[r=radius]"
Eg:
testfor @a[r=5]
Eg:
testfor @a[r=5]
I got it by adding this code to my countdown loop...
if command.exec( "testfor @a[r=13]" ) == false then
i = 60
end
And so the timer doesn't start going down again until players are close to the command computer.
This may seem like nothing, but it is a small victory for this school librarian who is trying to learn basic lua to make better Minecraft experiences for my students.
-Hawkins
#4
Posted 31 March 2017 - 06:32 PM
If you would like more features or help, posting the source code would help us understand what you mean. 
You can do this using "pastebin put <programName>" and then go to http://pastebin.com/<the weird Numbers and letters it writes>. You will then see your source code and can send us a link.
You can do this using "pastebin put <programName>" and then go to http://pastebin.com/<the weird Numbers and letters it writes>. You will then see your source code and can send us a link.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











