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

Bad arguement #1 (table expected, got double) with redstone io block

Question

Posted

I'm relativity new to lua (I know shell and python, basic c++, batch and the tiniest bit of java)  so i have absolutely no idea whats happening. I'm trying to make a basic fireworks launcher with dispensers around a redstone io block but for some reason it won't work. I've read the redstone api on the wiki and i still don't have a clue.

local component=require("component")
local sides=require("sides")
local rs=component.redstone
print("Launching Fireworks")
rs.setOutput(15)

Any help will be greatly appreciated as i then can use OC to control a lot more in my base.

2 answers to this question

Recommended Posts

  • 0
Posted

The error you received stems from the second variant of this function. You can call rs.setOutput like so..

-- # with a number side[0-5] and a signal strength
rs.setOutput(2, 15)

-- # using the sides api but basically the same thing
rs.setOutput(sides.east, 15)

-- # or by setting multiple sides at the same time by passing a table
rs.setOutput({
	-- # [sides.west] evaluates to a number side
	[sides.west] = 15,
	[sides.south] = 10
})

 

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.

Guest
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.

Loading...


×
×
  • Create New...

Important Information

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