Usergroup check not working?

Hey, I have a bit of code, and I’m trying to restrict the use of it to certain usergroups (vip, admin, ect.)

so here’s up to the if statement.



ply = LocalPlayer()
	
	Msg("Loaded Abilities")

	if ply:GetNWString("usergroup") == "vip" or ply:GetNWString("usergroup") == "admin" or ply:GetNWString("usergroup") == "superadmin" or ply:GetNWString("usergroup") == "owner" then


no error, the Msg(“Loaded Abilities”) prints to the console and when I;m those groups the if statement won’t go through. What’s going on?

The statement itself looks fine; add a print(ply:GetNWString(“usergroup”)) before the if and see what group you are actually in.

Alright, I figured out what was wrong, the if statement was happening before the usergroups were loaded, thanks for the amazing quick reply though! :slight_smile: