Admin Check [Before or After]?

Hey everyone my name is Nehoray

I have a quick question:
Should I put the admin check before or after player.Chatted

Code
game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		for i, Admin in pairs(Admins) do
			if player.Name == Admin then

Thanks for reading.

If only admins are allowed to have stuff happen when they chat something and non-admins don’t have any commands they can run, then it’s best to do the check before you create the event to reduce unneeded events being made.

But if non-admins have any command they are able to run, example, a ;jump command that anyone can run admin or not, then you have to do the check after you make the event and do some checking based on the message they sent and if they are an admin or not

3 Likes

Thanks for the answer, Really appreciate it :smiley:

1 Like

Anytime! If you have anymore issues or questions don’t be afraid to make another post!

1 Like