Help in VIP DARKRP

I need, when I add someone in the vip group, he gets 2500 money

I have this so far


if(SERVER) then
	VIPMONEY = 2500
local price = VIPMONEY

ply:addMoney(+price)




I think that might work. How do I make it automatic?

Do you have more code…? Like a function where if you set a certain group it gives them x amount of money? Or you can integrate that with the ulx adduser?

[lua]
if ply:IsUserGroup(“vip”) then
– do stuff
end
[/lua]

Stev I know, but i am not sure

If the thing i did will work!
Can anyone help me. Btw

If I do this would it work?

if ply:IsUserGroup(“vip”) then
VIPMONEY = 2500
local price = VIPMONEY

ply:addMoney(+price)
end

No you’ll get a syntax error for “+price”, drop the “+”

But will that work without the +?

+x does nothing mathematically. +(-7) = -7, +(4) = 4.

[lua]

if ply:IsUserGroup(“vip”) then
local VIPMONEY = 2500
local price = VIPMONEY

ply:addMoney(price)

end
[/lua]

No need for that many locals if they are static.

[lua]
– Top of your file
local VIPMONEY = 2500

– Inside your hook or whatever
if ply:IsUserGroup(“vip”) then
ply:addMoney(VIPMONEY)
end
[/lua]

Should this work subject?

Do what James said. I was just making it with the same variables you gave.

Didn`t work here

Post the code you are using, and any errors.

I got no codes :confused:

I think that he’s asking for a system that gives money to players when their usergroup changes…I would use a proxy in UserGroup nw var

Entity:SetNWVarProxy

And then run that, seems to be the most simple way to make this “Automatic”

Thanks :slight_smile: