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

gibbo3771

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by gibbo3771

  1. Ah right, the scope makes sense given that it's a interpreted line by line language. I had a look at the log and right enough, buildProgressBar is nil. So I tried changing the code around, to what you have described so the variable is declared and known, but unassigned. Kinda safely assuming functions are passed as reference, rather than a copy as it would make less sense. I can link the whole program, can't see it helping much! local c = require("component") local GUI = require("GUI") local buffer = require("doubleBuffering") local image = require("image") local note = require("note") loc
  2. So how come 'clearAndInitProgressBar' is working just fine? I thought it was due to declaring it as not local but changing that seems to have no effect. This piece of code is not crashing, but it should? That's weird. EDIT: Would also like to start that this: throwWitherBuildError("Can't build Wither with shield down, are you mad?!?!?") Is also declared at the end of my file, so technically this should work either right?
  3. So I am pretty new to Lua, having only used it very lightly in the past for basic scripts. I am having some issue that hopefully someone can help me with and it can be best described as a "function losing scope". I'll post the code and explain it. local buildWitherButton = app:addChild(GUI.roundedButton(buttonLeftAnchor, 13, buttonWidth, 7, buttonDefaultColor, bgColor, buttonPressedColor, bgColor, "BUILD WITHER")) buildWitherButton.onTouch = function() if(powerButton.pressed ~= true) then throwWitherBuildError("Can't build Wither with shield down, are you mad?!?!?") return en
×
×
  • Create New...

Important Information

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