Hey guys trying to make it so when you are level 12 you become regular. I have come up with this myself but am very amateur and its not working.
[CODE] if ply:GetLevel() == 12 and ply:IsUserGroup("user") then
ulx.adduser(nil, ply, "Regular")
else
end[/CODE]
I would use a function over a console command to set the rank if that function does in fact exist.
If that's all code you got you need to use a hook which is called when the player levels up or if that does not exist check at some interval if the player has leveled up.
Remove the else in your code.
[QUOTE=Shenesis;52057589]Why is it not working? Try doing a print inside the if and see if it's being executed at all. Also I don't think you should be using ulx.adduser for this. Have the server run the adequate command instead:
[lua]
RunConsoleCommand("ulx", "adduser", ply:SteamID())
[/lua][/QUOTE]
I would not do the command because then you will get a ugly print in chat saying console did it.. take a look inside the ulx addon where commands are stored and look at the ulx adduser command and see how they do it then simply copy + paste. The first var of ulx.adduser should not be nil that might be your error right there
[editline]5th April 2017[/editline]
And yeah like vexan said that else is not needed as you do not have anythjng
Sorry, you need to Log In to post a reply to this thread.