Getting the error message
ERROR: [string "Console"]:22: unexpected symbol near '<\226>'
at the the following
if string.match(unit.classname, “J%-15 Flying Shark [Su%-33 Copy]”) then points = 10
Any assisstance appreciated.
DB
Code: Select all
local side = "Blue" -- put the side that you are keeping track of scoring here
local currentScore = ScenEdit_GetScore(side) -- get the current score
local points = 0 -- default amount of points to award, set to zero so only explicitly set scores are used
local unit = ScenEdit_UnitX() -- get the unit wrapper for the unit that was destroyed
if unit.type == "Weapon" then
return --exit if destroyed unit is really a weapon
end
if -- initial score setup, defaults
unit.type == "Aircraft" then points = 10
elseif
unit.type == "Ship" then points = 50
elseif
unit.type == "Submarine" then points = 50
elseif
unit.type == "Facility" then points = 5
end
--red aircraft – J-15 Flying Shark, red submarine – Type 039C Yuan
--% sign is there because a dash is a special character, the % tells it to not use it as a special character
if string.match(unit.classname, “J%-15 Flying Shark [Su%-33 Copy]”) then points = 10
end
if string.match(unit.classname, “Type 039C Yuan”) then points = 50
end
currentScore = currentScore + points
print(unit.name.. " ("..UnitX().classname.." Sub Type: "..unit.subtype.." ) Destroyed - Points: "..points)
ScenEdit_SetScore(side, currentScore, unit.name.. " ("..unit.classname.." Sub Type: "..unit.subtype.." ) Destroyed - Points: "..points)