ents.AddCreateCallback("obj_sentrygun", function(ent) timer.Simple(0, function() if ent.m_iTeamNum ~= 3 then return end util.PrintToChatAll("Sentry spawned!") local allPlayers = ents.GetAllPlayers() for _,chief in pairs(allPlayers) do if chief:GetAttributeValue("hidden string attribute 1") == "ccc" then ent.m_hBuilder = chief util.PrintToChatAll("Sentry assigned to "..chief:GetPlayerName().."!") end end end) end)