Forum

> > CS2D > Scripts > cs2d !l lua error
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch cs2d !l lua error

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt cs2d !l lua error

Fuly
User Off Offline

Zitieren
help??


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

Spoiler >

alt Re: cs2d !l lua error

GeoB99
Moderator Off Offline

Zitieren
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)

alt Re: cs2d !l lua error

Yates
Reviewer Off Offline

Zitieren
>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.

alt Re: cs2d !l lua error

Lee
Moderator Off Offline

Zitieren
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

alt Re: cs2d !l lua error

Fuly
User Off Offline

Zitieren
-> [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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht