try this
function PlayMusic(element,sound)
if element and getElementType(element) == "player" then
local team = getPlayerTeam(element)
if team then
local cops = getPlayersInTeam(team)
triggerClientEvent(cops,"playMyMusic", element, copTeams)
end
end
end
addEventHandler("onColShapeLeave", prisonCol, PlayMusic)
or
function PlayMusic(element,sound)
if element and getElementType(element) == "player" then
local team = getPlayerTeam(element)
if team and team == "cops" then
triggerClientEvent(element,"playMyMusic", element, copTeams)
end
end
end
addEventHandler("onColShapeLeave", prisonCol, PlayMusic)