Pointshop Custom Code Error.

In my pointshop, I edited;
PS.Config.PointsOverTime = 10 to

[lua]
PS.Config.PointsOverTimeAmount = function( ply )
if ply:IsUserGroup(‘vip’) then
return 40
elseif ply:IsUserGroup(‘supervip’) then
return 20
else
return 10
end
end
[/lua]

It’s not giving me any points, or NO ERRORS

Anyone have a suggestion?

That won’t work. If you go into sv_player_extension.lua line 77 you’ll see the timer that gives players points over time. This uses the variable as the direct amount of points the player should be given. You make the variable a function and the function won’t work.

Instead, modify the timer to give the points directly instead of using the variable. Use comparatives to return your desired amount. Make a new variable above where the player is given the points. This is what I did:

[lua]if PS.Config.PointsOverTime then
timer.Create(‘PS_PointsOverTime_’ … self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function()
local CustomPointsOverTimeAmount = self:IsUserGroup(‘superadmin’) and 3 or self:IsUserGroup(‘operator’) and 2 or 1
if !IsValid(self) then return end
self:PS_GivePoints( CustomPointsOverTimeAmount )
self:PS_Notify("You’ve been given “, CustomPointsOverTimeAmount, " points for playing on the server!”)
end)
end[/lua]
Since this function is called using a player as a meta you use self:IsUserGroup() and not ply:IsUserGroup().

[lua] self:IsUserGroup(‘superadmin’) and 3 or self:IsUserGroup(‘operator’) and 2 or 1 [/lua]
If the player is superadmin, they receive 3 points, if they are operator, they receive 2 points, and otherwise they receive 1.

I posted in the official undefined pointshop thread, but got no responses. I can’t seem to figure out the issues. I am not getting any errors or anything.
[lua] if PS.Config.PointsOverTime then
if (tonumber(os.date("%V")) % 2 == 1) and (tonumber(os.date("%u")) == 7) then
timer.Create(‘PS_PointsOverTime_’ … self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function()
self:PS_GivePoints(PS.Config.PointsOverTimeAmount * 2)
self:PS_Notify(" * * * * DOUBLE POINTS DAY * * * * ")
self:PS_Notify("You’ve been given “, PS.Config.PointsOverTimeAmount * 2, " points for playing on the server!”)
end)
else
timer.Create(‘PS_PointsOverTime_’ … self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function()
self:PS_GivePoints(PS.Config.PointsOverTimeAmount)
self:PS_Notify("You’ve been given “, PS.Config.PointsOverTimeAmount, " points for playing on the server!”)
end)
end
end[/lua]

This is not your thread, make a new one :stuck_out_tongue:

Also, what is the actual problem you are getting?