Giving Health Via Pointshop Help

Hello Everyone, so right now i am trying to make it so you can purchase heath via the pointshop, but my code doesn’t seem to work. Sorry i am new to fairly new to LUA, and i need some help with this.

Here is the code:


ITEM.Name = '25 Health'
ITEM.Price = 45
ITEM.Model = 'error'
ITEM.SingleUse = true

function ITEM:OnBuy(ply)
	ply:Give(self.GiveHealth(25))
end

function ITEM:OnSell(ply)
	ply:StripWeapon(self.WeaponClass)
end

ply:Give(self.GiveHealth(25))

That’s not how you add health.

Do ply:SetHealth( ply:Health() + 25 )

oh lol, sorry im new to this language, ty

[editline]25th February 2014[/editline]

Now is there a way where you can’t go over a certain heath, but if you go lower, you can buy it again

[lua]local limit = 75
local health = ply:Health()

if (health > limit) then
– Their health is over 75
else
– Their health is less than or equal to 75
end[/lua]