Hi there everybody!
So I’m basically trying to create an time-experience system where every minute you play as either a criminal or hero job, you get a +1 experience in either path.
I have no idea how player stored vars work so please someone help me out
This is what I just scratched up I don’t even know if it works, please let me know what I’m doing and not doing, cheers.
local clock = os.clock function sleep(n) -- seconds local t0 = clock() while clock() - t0 <= n do end end function PLAYER:SetupDataTables() self.Player:NetworkVar("Int", 0, "CriminalExperience" ) self.Player:NetworkVar("Int", 0, "HeroExperience" ) if SERVER then hook.add("OnPlayerChangedTeam", "InitXPGain", function() while after == TEAM_THUG or after == TEAM_MOBSTER do sleep(60) self:SetCriminalExperience((self:CriminalExperience + 1)) end while after == TEAM_POLICE or after == TEAM_SWAT do sleep(60) self:SetHeroExperience((self:HeroExperience + 1)) end end end