amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 20 Feb 2017 12:35 PM |
I'm trying to use a do-not-block, however it's erroring.
do not print("taco") end
Error in script: unexpected symbol near 'not' |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Feb 2017 12:36 PM |
| Nice username. What exactly were you intending that ### of code to do? |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 20 Feb 2017 12:41 PM |
A do-not-block is suppose to have all the scope of a do-block, however not execute any of it.
I had a big script with a lot more variables, but it wasn't working so I'm testing it with a print function.
Ideally, it's suppose to not print taco. But it's also not suppose to error. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:41 PM |
while wait() do if not workspace:FindFirstChild("Part") then print("taco") end end
|
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:42 PM |
| you can't negate a call to a function like that with ### 'not' operator what's wrong with commenting it out if you ##### #### ## to run? |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:42 PM |
you can't negate a call to a function like that with 'not' operator what's wrong with commenting it out if you don't want it to run?
|
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:42 PM |
| This so-called "do-not-block" is not a feature of Lua. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 20 Feb 2017 12:43 PM |
It's not negating it, it's just a standard do-not-block.
I'm trying to figure out why it's throwing that error. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:44 PM |
| Please read the above posts, esp. the one from Unsubtleties. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:45 PM |
well I meant more like neutralizing it/canceling it out and yeah "do not" blocks don't work in lua
|
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:55 PM |
Thats not a feature of LUA that I know of, but you can do this.
do = false if do then print("Done") end |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 20 Feb 2017 12:58 PM |
Alright. I've figured out a workaround, however for another part of my script I need to utilize a do-maybe block.
Any assistance? |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 12:58 PM |
explain what "do-maybe" means first lol
|
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 20 Feb 2017 01:00 PM |
A standard do-maybe block gives a 50-50 chance of running.
Completely built into Lua as far as I'm aware.
do maybe print("tacos") end |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2017 01:02 PM |
if math.random(2) == 1 then ... end
|
|
|
| Report Abuse |
|
|