Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0

player program to set off firework machine


im new to open computers and I need this for a convention limbocon


set off firework machine if we get 500 players


ok so heres what I need I need a program which uses this command getplayers()table and link it to a variable x.

so I need it to be like this if redstone signal is false do nothing if true run the getplayers()table command tie it to x and make a rule if x>500 (over 500) then send redstone signal and power off machine

if x <500 do nothing


preferably today/tomorrow in time for the event

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
local component = require("component")
local sides = require("sides")
local rs = component.redstone
local dbg = component.debug
local computer = component.computer
local x = 0
local input = sides.left
local output = sides.right
while true do
  if rs.getInput(input) > 0 then
    x = #dbg.getPlayers()
    print("Players Updated!")
  if x >= 500 then
    rs.setOutput(output, 15)

Requires a redstone card and a debug card.

Feel free to change the definitions of the sides input and output.

Download from pastebin with this command:

pastebin get suXkJWnw fireworks.lua


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.