corona sdk runtime error

bad argument #1 to ‘gsub’(string expected, got table)

here is d code :

main.lua

display.setStatusBar(display.HiddenStatusBar);

local composer = require “composer”

local mainGroup = display.newGroup();

_W = display.contentWidth;
_H = display.contentHeight;
centerX = display.contentCenterX
centerY = display.contentCenterY

local path = system.pathForFile( “myGameSettings.json”, system.DocumentsDirectory )

local createNewMGS, errStr = io.open( path, “r” )

if createNewMGS then

else

createNewMGS = io.open( path, “w” )
if createNewMGS then
print( “Created new myGameSettings” )
local loadsave = require(“loadsave”)
myGameSettings = {}
myGameSettings.highScoreWorld1 = 0
myGameSettings.highScoreWorld2 = 0
myGameSettings.highScoreWorld3 = 0
myGameSettings.highScoreWorld4 = 0
myGameSettings.highScoreWorld5 = 0

    myGameSettings.jet = "jet1.png"
    myGameSettings.language = "English"
    myGameSettings.musicVolume = "0.25"

    myGameSettings.world = "world1"

    myGameSettings.plane2 = "plane2L.png"
    myGameSettings.plane3 = "plane3L.png"
    myGameSettings.plane4 = "plane4L.png"
    myGameSettings.plane5 = "plane5L.png"
    
    myGameSettings.terrain2 = "terrain2L.png"
    myGameSettings.terrain3 = "terrain3L.png"
    myGameSettings.terrain4 = "terrain4L.png"
    myGameSettings.terrain5 = "terrain5L.png"
    
    myGameSettings.jetHeaviness = "26"
    myGameSettings.jetScale = "1"
    myGameSettings.missileImage = "Missile1.png"
    myGameSettings.fuelTime = "150"
    myGameSettings.shieldTime = "150"
    myGameSettings.twoBulletQuantity = "10"

    myGameSettings.speed2 = "speed2.png"
    myGameSettings.speed3 = "speed3.png"
    myGameSettings.speed4 = "speed4.png"
    myGameSettings.object5 = 5
    myGameSettings.sceneSpeed = 10
    myGameSettings.coin = 1000
    myGameSettings.soundOn = true
    myGameSettings.musicOn = true

    myGameSettings.colorR = 66
    myGameSettings.colorG = 139
    myGameSettings.colorB = 181
    
   myGameSettings.colorCR = 255
    myGameSettings.colorCG = 255
    myGameSettings.colorCB = 255
    
    myGameSettings.rateAppInAppStore = false;
    myGameSettings.facebookLike = false;
    myGameSettings.twitterLike = false;
    myGameSettings.googleLike = false;
    
   myGameSettings.settings1 = 0
    myGameSettings.settings2 = 0
    myGameSettings.settings3 = 0
    myGameSettings.settings4 = 0
    myGameSettings.settings5 = 0
    
    loadsave.saveTable(myGameSettings, "myGameSettings.json")

else
print( “Create file failed!” )
end
end
io.close( createNewMGS )

local loadsave = require(“loadsave”)

myGameSettings = {}
myGameSettings.highScoreWorld1 = 0
myGameSettings.highScoreWorld2 = 0
myGameSettings.highScoreWorld3 = 0
myGameSettings.highScoreWorld4 = 0
myGameSettings.highScoreWorld5 = 0

myGameSettings.jet = “jet1.png”
myGameSettings.language = “English”
myGameSettings.musicVolume = “0.25”

myGameSettings.world = “world1”

myGameSettings.plane2 = “plane2L.png”
myGameSettings.plane3 = “plane3L.png”
myGameSettings.plane4 = “plane4L.png”
myGameSettings.plane5 = “plane5L.png”

myGameSettings.terrain2 = “terrain2L.png”
myGameSettings.terrain3 = “terrain3L.png”
myGameSettings.terrain4 = “terrain4L.png”
myGameSettings.terrain5 = “terrain5L.png”

myGameSettings.jetHeaviness = “26”
myGameSettings.jetScale = “1”
myGameSettings.rocketImage = “rocket_one.png”
myGameSettings.fuelTime = “150”
myGameSettings.shieldTime = “150”
myGameSettings.twoBulletQuantity = “10”

myGameSettings.speed2 = “speed2.png”
myGameSettings.speed3 = “speed3.png”
myGameSettings.speed4 = “speed4.png”
myGameSettings.objectSpeed = 5
myGameSettings.sceneSpeed = 10
myGameSettings.coin = 1000
myGameSettings.soundOn = true
myGameSettings.musicOn = true

myGameSettings.colorR = 66
myGameSettings.colorG = 139
myGameSettings.colorB = 181

myGameSettings.colorCR = 255
myGameSettings.colorCG = 255
myGameSettings.colorCB = 255

myGameSettings.rateAppInAppStore = false;
myGameSettings.facebookLike = false;
myGameSettings.twitterLike = false;
myGameSettings.googleLike = false;

myGameSettings.settings1 = 0
myGameSettings.settings2 = 0
myGameSettings.settings3 = 0
myGameSettings.settings4 = 0
myGameSettings.settings5 = 0

myGameSettings = loadsave.loadTable(“myGameSettings.json”)

local function main()

composer.gotoScene( "menu1" )
return true;

end
main();


menu.lua file :

module(…, package.seeall);

local sceneName = menu

local composer = require( “composer” )

local scene = composer.newScene( sceneName )

function new()
local GUI = display.newGroup();

local widget = require("widget");



local planeNO = 0
local plane2Status = myGameSettings.plane2
local buyGoldAlert = 0;

local background = display.newImageRect("home.png",_W,_H)
background.anchorX = 0.5
background.anchorY = 0.5

background.x = display.contentCenterX
background.y = display.contentCenterY

local goldImage = display.newImage("gold.png",10,15)
local goldText = display.newText("", 0, 0, "Antonio-Bold", 30)
goldText.text = myGameSettings.coin; 

goldText.x = 60; goldText.y = 38;
local moreBtn = display.newImage("moreBtn.png")
moreBtn.y = 390; moreBtn.x = 150;
local buyGold = display.newImage("getCoins.png")
buyGold.x = _W /2; buyGold.y = 390;

local planeCustom = display.newImage("planeCustom.png")
planeCustom.x = 200; planeCustom.y = 220; planeCustom:scale(0.8,0.8)
local plane1 = display.newImage("plane1.png")
plane1.x = 600; plane1.y = 220; plane1:scale(0.8,0.8)

GUI:insert(background);
GUI:insert(goldImage);
GUI:insert(moreBtn);
GUI:insert(buyGold);
GUI:insert(nextBtn);

GUI:insert(plane1);
GUI:insert(planeCustom);
end

function scene:create( event )
local sceneGroup = self.view
new();
end

function scene:show( event )
local sceneGroup = self.view
local phase = event.phase

if phase == "will" then
    -- Called when the scene is off screen and is about to move on screen
elseif phase == "did" then
    -- Called when the scene is now on screen
    -- INSERT code here to make the scene come alive
    -- e.g. start timers, begin animation, play audio, etc
	
end 

end

function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase

if event.phase == "will" then
    -- Called when the scene is on screen and is about to move off screen
    --
    -- INSERT code here to pause the scene
    -- e.g. stop timers, stop animation, unload sounds, etc.)
elseif phase == "did" then
    -- Called when the scene is now off screen
end 

end

function scene:destroy( event )
local sceneGroup = self.view

-- Called prior to the removal of scene's "view" (sceneGroup)
-- 
-- INSERT code here to cleanup the scene
-- e.g. remove display objects, remove touch listeners, save state, etc

end

scene:addEventListener( “create”, scene )
scene:addEventListener( “show”, scene )
–scene:addEventListener( “hide”, scene )
–scene:addEventListener( “destroy”, scene )

return menu;

First: Use LUA Tags
Second:

http://puu.sh/cw7Wg/ebb41ddb50.png

iirc corona is some sort of mobile framwork, right?

I only remember “Corona” being used in some iPhone jailbreaks, you are probably on the wrong forum.

Not full code, gsub is not found in this code, post full code and post it correctly.