Hello, i have a problem with a stats script i want to use with VLE but how can i get this to work without having problems with onPlayerConnect and onPlayerDeath functions VLE uses.
This is the stats script:
If someone could help me out would be nice

-- Give the other player money
if getPlayerCash(PlayerID) > 500 then
givePlayerCash(PlayerID,-DEATH_MONEY)
outputChatBox(KillerID,"Congratulations! You have obtained $" .. DEATH_MONEY .. " from your ace kill!",0,255,0,255)
givePlayerCash(KillerID,DEATH_MONEY)
else
if getPlayerCash(PlayerID) == 0 then
outputChatBox(KillerID,"Your opponent is broke and thus you have not received any money. :-(",0,255,0,255)
else
outputChatBox(KillerID,"Congratulations! You have obtained $" .. getPlayerCash(PlayerID) .. " from your ace kill!",0,255,0,255)
end
givePlayerCash(KillerID,getPlayerCash(PlayerID))
setPlayerCash(PlayerID,0)
end
end

-- Loop through all of the players
for i = 0, 100 do
if isPlayerConnected(i) == 1 then
local Player = strval(i)
local Ratio = 0
if Deaths[Player] == 0 then
if Kills[Player] == 0 then
Ratio = 1
else
Ratio = Kills[Player]
end
else
Ratio = (((Kills[Player]) / (Deaths[Player])) / 100.0) * 100
end
if Ratio > TopRatio then
TopPlayerRatioID = Player
TopRatio = Ratio
end
if Kills[Player] > TopKills then
TopKills = Kills[Player]
TopPlayerKillID = Player
end
end
end

-- Double check
for i = 0, 100 do
if isPlayerConnected(i) == 1 then
local Player = strval(i)
local Ratio = 0
if Deaths[Player] == 0 then
if Kills[Player] == 0 then
Ratio = 1
else
Ratio = Kills[Player]
end
else
Ratio = (((Kills[Player]) / (Deaths[Player])) / 100.0) * 100
end
local Found = false
if Ratio == TopRatio and Player ~= TopPlayerRatioID then
TopPlayerRatioID = -1
Found = true
end
if Kills[Player] == TopKills and Player ~= TopPlayerKillID then
TopPlayerKillID = -1
Found = true
end
if Found == true then break end
end
end

-- Now output
local TopKillName = "N/A"
local TopNameRatio = "N/A"

if TopPlayerKillID > -1 then TopKillName = getPlayerName(strval(TopPlayerKillID)) end
if TopPlayerRatioID > -1 then TopNameRatio = getPlayerName(strval(TopPlayerRatioID)) end