Forum

> > CS2D > Scripts > cs2d !l lua error
Forums overviewCS2D overview Scripts overviewLog in to reply

English cs2d !l lua error

7 replies
To the start Previous 1 Next To the start

old cs2d !l lua error

Fuly
User Off Offline

Quote
help??


-> [C]: in function 'parse'
-> sys/lua/roleplay.lua:4016: in function <sys/lua/roleplay.lua:3906>

Spoiler >

old Re: cs2d !l lua error

GeoB99
Moderator Off Offline

Quote
Not sure in which part of "parse" function has this issue since either you or the Console didn't explain the exact origin of this error. Try to invert wpn and id near 35 line but I highly doubt that would work.
1
function projectile_hook(wpn, id, x, y)

old Re: cs2d !l lua error

Yates
Reviewer Off Offline

Quote
>error line 4016
>post only contains 271 lines

Classic mistake. Update your error responding to the lines in your post, or post the line where the error occurs.

It's up to you.

old Re: cs2d !l lua error

Lee
Moderator Off Offline

Quote
Looks like you have to handle the error generated by parse with lua code. Why not just wrap it within a pcall?

1
2
3
4
5
if pcall(parse, ('lua "%s"'):format(lua)) then
  msg2(id, "Success")
else
  msg2(id, "Failed to parse lua command")
end

old Re: cs2d !l lua error

Fuly
User Off Offline

Quote
-> [C]: ?
-> [C]: in function 'pcall'
-> sys/lua/roleplay.lua:3946: in function <sys/lua/roleplay.lua:3836>

No @user Lee: error

1
2
3
4
5
if pcall(parse, ('lua "%s"'):format(lua)) then
              msg2(id, "Success")
              else
              msg2(id, "Failed to parse lua command")
             end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview