Command Messup

Ok, I have a command for giving money, but anyone below superadmin can use it. Can someone help please?



concommand.Add("bw_addmoney", function(ply, cmd, args)
	local amount = tonumber(args[1])
	if !amount then return end
	if !ply:IsSuperAdmin then return end
	ply:AddMoney(amount)
end)


You didn’t copy and paste the code correctly, and if you’re using ULX any group that inherits superadmin can use it.



concommand.Add("bw_addmoney", function(ply, cmd, args)
	local amount = tonumber(args[1])
	if !amount then return end
	if !ply:IsSuperAdmin() then return end
	ply:AddMoney(amount)
end)


Ohhh I see my error. Ok so I set a team as “owner” and also declared that team as owner in ULX, so if I used:



concommand.Add("bw_addmoney", function(ply, cmd, args)
	local amount = tonumber(args[1])
	if !amount then return end
	if !ply:Team(4) then return end
	ply:AddMoney(amount)
end)


Would it work?

[editline]30th January 2013[/editline]

Nevermind.


concommand.Add("bw_addmoney", function(ply, cmd, args)
	local amount = tonumber(args[1])
	if !amount then return end
	if !ply:IsUserGroup("owner") then return end
	ply:AddMoney(amount)
end)