Lua help

Hi guys, I recently had a automatic donation system setup by Cbrad24 and he done a excellent job ( Would recommend him to anyone… ) but I bug him enough as it is asking for help on editing it and i’m sure he is busy enough as it is. So the question is could someone please try to fix this bit of code for me I’ve done what I can to it but still I’m unable to get it to work the way I would like it to. Here is the code:



if ply:IsUserGroup( "user" ) and credz == 350 or credz == 650 or credz == 1000 then
	ply:PS_GivePoints( 500 )
	AddDonor( ply )
elseif ply:IsUserGroup( "respected" ) or ply:IsAdmin() and credz >= 100 then
	ply:PS_GivePoints( math.floor( PointsPerPound * ( credz / 100 ) ) )
end


Right so what I want this to do is, If a player purchases vip with the set amounts (credz == 350 or credz == 650 or credz == 1000) and he is the rank ‘user’ then set him to vip and give the user 500 points. that part works fine, its the next part that does not e.g:



elseif ply:IsUserGroup( "respected" ) or ply:IsAdmin() and credz >= 100 then
	ply:PS_GivePoints( math.floor( PointsPerPound * ( credz / 100 ) ) )
end


If the player is either the rank respected (vip) or the player is admin and the amount he paid is greater than 1 pound then give him points based on the amount he paid. e.g: 200 points per pound. The problem is it doesnt matter if your admin or vip it will always give you the set amount of points ( 500 ).

Hope this makes sense if not then I’m sorry but its sort off hard to explain plus I have not slept yet :/.

Regards,
Dave


(User was banned for this post ("Undescriptive thread title" - Gran PC))

Heyo Dave.
I don’t know the code behind it all … but if all the functions are working correctly…
I think it will ignore the “if ply:IsUserGroup( “user” ) …” if the credz is 650 or 1000.
I’ll change the line to this:
[lua]
if ply:IsUserGroup( “user” ) and (credz == 350 or credz == 650 or credz == 1000) then
[/lua]
Simple :slight_smile:

Why not credz>=350 ?

Because he might want them to be exact 350, 650 or 1000
but I agree … if people should get the respected rank, regardless if its more that 350, then it’s simple this:
[lua]if ply:IsUserGroup( “user” ) and credz >= 350 then[/lua]