Not sure if this works

Well basically I started learning lua like maybe 5 months ago, kinda pushed it off and forgot about it until today. I basically forgot like everything I learned :confused: So basically I’m trying to make an admin detector; whenever an admin/superadmin joins the game it’ll play a sound alerting you that an admin has joined. Here’s what I got so far:


function GM:PlayerInitialSpawn(ply)
	if ply:IsAdmin() or ply:IsSuperAdmin() then
		surface.PlaySound(join_admin.mp3)
	end	
		return ply:IsAdmin()
		return ply:IsSuperAdmin()
end

Now the thing is, I tried making an admin detector before and it worked, except it would only play the alert sound once if an admin joined, wouldn’t play it again if any more admins joined. I’m trying to make it so when the script runs it’ll basically run again if more admins joined. The code above isn’t what my old admin-detecting script was like, I believe I had a


hook.Add("PlayerInitialSpawn", "yadda yadda", yadda yadda)

at the end and the function was simply


function AdminDetector()

Tl;dr Is the code at the top correct? Sorry if everything’s all retarded and shit, I’m still a noob ._.


(User was banned for this post ("undescriptive thread title" - postal))