I hope now work)
function addStat(thePlayer, theStat, theValue)
local getActualPoints = getElementData(thePlayer, "Points")
local getActualCash = getElementData(thePlayer, "Cash")
if theStat == "Cash" then
setElementData(thePlayer, "Cash", getActualCash + theValue)
elseif theStat == "Points" then
setElementData(thePlayer, "Points", getActualPoints + theValue)
end
end
function onPlayerWins(player)
local players = getPlayerCount()
local points = players * 1.3
local pointsstat = "Points"
local cash = players * 7
local cashstat = "Cash"
addStat(thePlayer, pointsstat, points)
addStat(thePlayer, cashstat, cash)
end
or easier:
function addStat(thePlayer, theStat, theValue)
setElementData(thePlayer, theStat, getElementData(thePlayer,theStat) + theValue)
end
function onPlayerWins(player)
local players = getPlayerCount()
local points = players * 1.3
local pointsstat = "Points"
local cash = players * 7
local cashstat = "Cash"
addStat(thePlayer, pointsstat, points)
addStat(thePlayer, cashstat, cash)
end