Jump to content




")" expected while there is a bracket


5 replies to this topic

#1 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 11 May 2019 - 09:27 PM

While I indeed expect to be blasted by people with this ugly, hardly readable line of code I'm about to barf here, I am having a problem.

I am creating a program to replace mobs with armoured mobs (Using a Command Computer). All data handling and such is done elsewhere in the code, and I have confirmed that it works and carries the correct information. However, the line I am using to actually spawn the new mob throws an unexpected error:
")" expected

I am confused about this. I see no syntax being broken. I would appreciate if somebody could explain what is going on here and why it is occurring

commands.exec(
"execute @e[type="..tag["Name"]..",tag=!enhanced] ~ ~ ~
/summon "..tag["Name"].." ~ ~ ~
{
ArmorItems:[
{Count:"..tag["Data"][1]["Count"]..",id:"..tag["Data"][1]["Item"].."},
{Count:"..tag["Data"][2]["Count"]..",id:"..tag["Data"][2]["Item"].."},
{Count:"..tag["Data"][3]["Count"]..",id:"..tag["Data"][3]["Item"].."},
{Count:"..tag["Data"][4]["Count"]..",id:"..tag["Data"][4]["Item"].."},
{}
],
ArmorDropChances:["..tag["Data"][1]["Chance"].."F,"..tag["Data"][2]["Chance"].."F,"..tag["Data"][3]["Chance"].."F,"..tag["Data"][4]["Chance"].."F],
Tags:[\"enhanced\"]}")

I put it in a pastebin for if you needed a single line

Thanks in advance

Edit: Forgot to add an F

Edit2: Here is the function associated with this line

Edited by Hydrotronics, 12 May 2019 - 08:35 AM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 11 May 2019 - 11:44 PM

Please post the entire code.

#3 Purple

  • Members
  • 92 posts
  • LocationAlone in the dark, looking at the pretty lights with dreams of things I can not have.

Posted 12 May 2019 - 08:15 AM

Indeed. The error you are getting is that somewhere in the code you are missing a ). Which can very well be happening just above your line and than your line is just reporting it.

#4 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 12 May 2019 - 08:37 AM

Added the function being made with the problematic code

#5 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 12 May 2019 - 12:31 PM

Line 15 in the pastebin has a ] instead of ) on the end

#6 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 12 May 2019 - 01:04 PM

oh. Loading up my game again, I can indeed see it was saying that line. I must have read it wrong somehow.. Sorry for such a silly post, then ^^; But thank you for pointing this out to me
I was looking at lines 13 and up, because I thought it said that line for some reason.

Fixing that does conclude this part of the code, as well, so thank you





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users