Jump to content

Help, I'm confused


Recommended Posts

Hello, there,

I have a serious problem. My MTA has patched when I started it. After that I ran the server, joined and started my script, that worked today at 1 AM. Now I get errors.

debugscript says that this:

--[[

Something here so it's commented.

--]]

is deprecated, as well as it says that i have and unexpected character near "[" in this line:

outputChatBox(tostring(i).."|"..items[slot[3]][2])

 

Again. The exact same script has worked at 1AM today.

What did the patch change?

Link to comment
  • Administrators

Does doing this change anything?

local key = slot[3]
outputChatBox(tostring(i).."|"..items[key][2])

If not, I expect something is going wrong elsewhere in the code.

How big is this script file? Could you show more, via pastebin or such?

Link to comment

No. I'm sure that the problem this time is not with my code. I haven't changed a thing and the script worked before the patch. Now it says that the nesting of --[[...]] is deprecated, which is a basic lua block comment, so WTF and your idea hasn't worked either, when I tried it now. So something went wrong with the patch, which is annoying, since it makes me unable to move forward with my work.

Link to comment

The problem is not with the script. As I said the exact same script worked at 1AM today.

However

here's an error msg that I've never seen before.

IMGUR IMAGE

and that line:

--[[ <--- This is line 274
	elseif (dragNDrop == true) and (cX < 0.675) or (cX > 0.975) or (cY < 0.325) or (cY > 0.675) then
	dragNDrop = false
	draggedItem = nil
	-- Some item drops on the ground thingy here.
--]]

 

Also the whole script is 402 lines sooo...

Edited by StormFighter
Added more
Link to comment

SOLVED!

There was a block comment opening like a 100 lines above. Sorry guys and thank you for your help.

51 minutes ago, Tails said:

Check if you have multiple comment blocks like this:


--[[
	some code


--[[
	some other code
--]]


--]]

you can't do this.

As I found out, that is allowed.

On the other hand:

--[[
	--[[
	--]]
--]]
-- THIS is not.

-- For others if they find this, to learn.... My problem was this :S

--[[ -- The problem was this, like a 100 lines above, since I haven't closed It so the second block comment was in it.

--[[ The error said that the problem is in this line.
--]] 

 

Link to comment
  • Moderators

Indeed you can't nest comment tags.

I love to comment things and leave them like that until I need them, so I often run in to the nesting problem while adding more comments for multiple lines. Yet after a while the problem becomes almost a habit, so keep commenting more! more! more!

Or just use: ctrl + Q(Notepad++) which will add only line comments for the selected lines. (instead of --[[ ]] it will only add --)

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...