PointShop Point Rate

As shown on another thread like this:

I too have the same question. I didn’t want to bump a 5 month old thread though.

Anyways, someone suggested the following fix:

However, when I apply this change no users gain points at any rate after this.
Also, I’m using ULX and ULX Groups. If that matters.

Thank you.

Is your ULX group called vip in lowercase?

Change the group in the code to match your ULX groups.

It is adjusted to match my ULX Group.

I have it as such:


	if PS.Config.PointsOverTime then
		timer.Create('PS_PointsOverTime_' .. self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function()
			if !IsValid(self) then return end
            if ply:IsUserGroup( "pvip" ) then
                self:PS_GivePoints(PS.Config.PointsOverTimeAmountVip)
            else
                self:PS_GivePoints(PS.Config.PointsOverTimeAmount)
            end
			self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmount, " ", PS.Config.PointsName, " for playing on the server!")
		end)
	end
    
end

and in sh config



PS.Config.NotifyOnJoin = true -- Should players be notified about opening the shop when they spawn?

PS.Config.PointsOverTime = true -- Should players be given points over time?
PS.Config.PointsOverTimeDelay = 5 -- If so, how many minutes apart?
PS.Config.PointsOverTimeAmount = 5 -- And if so, how many points to give after the time?
PS.Config.PointsOverTimeAmountVip = 6 -- Thats 20% more income for VIPs

and dunno if this matters but I did this as well in sh config



PS.Config.CalculateBuyPrice = function(ply, item)
	-- 25% off for the 'donators' group
	if ply:IsUserGroup('pvip') then return math.Round(item.Price * 0.65) end
	
	return item.Price
end

PS.Config.CalculateSellPrice = function(ply, item)
	if ply:IsUserGroup('pvip') then return math.Round(item.Price * 0.489) else return math.Round(item.Price * 0.75) end
end


EDIT: Could ulx Utime be interfering with pointshop?

EDIT2: Found the error

Thank you for your ever increasing help.

EDIT: Old Thread http://forum.facepunch.com/showthread.php?t=1342700
Didn’t think it would head to this.

[lua]
if ply:IsUserGroup( “pvip” ) then
[/lua]

needs to be
[lua]
if self:IsUserGroup( “pvip” ) then
[/lua]

ya stupid me. Just figured that out. But thanks :confused:

EDIT:

Welp I did another change and now the server lags beyond belief.


	if PS.Config.PointsOverTime then
		timer.Create('PS_PointsOverTime_' .. self:UniqueID(), PS.Config.PointsOverTimeDelay * 60, 0, function()
			if !IsValid(self) then return end
			-- Need to Comment Shit this is VIP extended rate
            if self:IsUserGroup( "pvip" ) then
                self:PS_GivePoints(PS.Config.PointsOverTimeAmountVip)
				self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmountVip, " ", PS.Config.PointsName, " for playing on the server!")
            else
                self:PS_GivePoints(PS.Config.PointsOverTimeAmount)
				self:PS_Notify("You've been given ", PS.Config.PointsOverTimeAmount, " ", PS.Config.PointsName, " for playing on the server!")
            end
			-- End VIP Shit
		end)
	end

Why would that cause things to go crazy? I just added the Notify into the If statment so that it gives the correct update per player type.

EDIT: Nvm the change in tick rate I made did that.