[ERROR] LuaCmd:1: ')' expected near '""'



[ERROR] LuaCmd:1: ')' expected near '""'
  1. unknown - LuaCmd:0


Does anyone know what would cause this error? It happens client-side when using undo while pasting an advdupe2 dupe and I’m trying to fix it.

Maybe something’s hitting the ~255 char limit of SendLua?

Yeah I found this



undo.Owner:SendLua( 'hook.Run("OnUndo","' .. undo.Name .. '","' .. undo.CustomUndoText .. '")' )


and the advdupe2 code is this



undo.Create("AdvDupe2_"..Player:UniqueID())
	undo.SetPlayer(Player)
	undo.SetCustomUndoText(string.format("Undone Advanced Duplication \"%s\"",Player.AdvDupe2.Name or ""))
	undo.AddFunction(RemoveSpawnedEntities, i)
undo.Finish()


[editline]16th August 2015[/editline]

changed it to
[lua]
undo.Create(“AdvDupe2_”…Player:UniqueID())
undo.SetPlayer(Player)
undo.SetCustomUndoText("Undone " … (Player.AdvDupe2.Name or “”))
undo.AddFunction(RemoveSpawnedEntities, i)
undo.Finish()
[/lua]

and it works. not sure if it is possible to inject lua though…

[editline]16th August 2015[/editline]

string.format( “Undone Advanced Duplication %q”, Player.AdvDupe2.Name or “” )

Problem with that is the SendLua it gets appended to expects no quotations in the string.