Disable noclip for a certain team?

How can i disable noclip for a certain team? (will go in the ‘init.lua’ file)

[lua]function DisableTheNoclip(ply)
if ply:Team() == TEAM_MYTEAM then
return false;

That didnt work, but i noticed if the server noclip is on or off, you can still fly around no matter what team you are on. How do i fix that?

Is this for Assmod? Players who join the server after being banned return as ‘previously banned’ and can use noclip.

Make sure you changed TEAM_MYTEAM to the ID of your team