Experience code for my gamemode

So, I’ve got no idea how ELSE I may make it without making it from the beginning and etc.

Comments explain everything
[lua]function GM:DoPlayerDeath( ply, attacker, dmginfo )
//Set locals
local VictimID = ply:SteamID()
local VictimIDfile = string.gsub(VictimID,":","_")

local BullyID = attacker:SteamID()
local BullyIDfile = string.gsub(BullyID,":","_")

//Add deaths
ply:AddDeaths( 1 )

//Check if Victim and Player 
if ply:IsPlayer() and attacker:IsPlayer() then

//Add frags
attacker:AddFrags( 1 )

//Check Victims LVL
local VictimStats = file.Read ("black_rose/data/accounts/" ..VictimIDfile.. ".txt")
local VictimLoadStats = glon.decode(VictimStats)

//Count Bullys Exp
local Exp_Up = VictimLoadStats["lvl"] * ExpRate

//Check Bullys Exp
local BullyStats = file.Read ("black_rose/data/accounts/" ..BullyIDfile.. ".txt")
local BullyLoadStats = glon.decode(BullyStats)

//Add Bullys Exp
local exp = BullyLoadStats["exp"] + Exp_Up
local BullyLoadStats["exp"] = exp

//Save Bullys Exp
fBullyLoadStats = glon.encode(BullyLoadStats)
file.Write("black_rose/data/accounts/" .. BullyIDfile .. ".txt", fBullyLoadStats)


After trying this way, I get: [gamemodes\black_rose\gamemode\init.lua:62] unexpected symbol near ‘)’

While trying other way, I get no errors but it still doesn’t work, first I wanted to see if maybe HUD fails and won’t show the real exp but the one that was at the beginning, but I looked into file and it was still 0 too

I wouldn’t write it to a txt file use either http://wiki.garrysmod.com/?title=Player.SetPData or http://wiki.garrysmod.com/?title=Sql though i’m not sure the pro’s and con’s of each.

What line does the error occur on?

I removed one useless line and so it shows error on…
[gamemodes\black_rose\gamemode\init.lua:61] unexpected symbol near ‘[’
61 which is
[lua] local BullyLoadStats[“exp”] = BullyLoadStats[“exp”] + Exp_Up[/lua]

Remove the local.

In this line or in whole function ?

@EDit, works thanks !