I'm currently working on a murder/mafia style game and am trying to make a marker icon that shows the killer where the players are (allowing him to see if they're behind a wall for example)
So far I've created a script in the ServerScriptService that clones a billboardgui (holding the icon and set to "AlwaysOnTop") team from the ServerStorage and parents it to the head of the player on the "innocent" team (it does this to every player on that team)
Here's the relevant bit of code:
local victims = game.Teams["Innocent"]:GetPlayers()
for _,player in pairs(victims) do
local killerweaponcloned = killerweapon:Clone()
killerweaponcloned.Parent = player.Backpack
local clonedvictimicon = victimicon -- game:GetService("ServerStorage"):WaitForChild("VictimIcon")
clonedvictimicon.Parent = game.Workspace:WaitForChild(player.Name).Head
end
end
Currently these icons are visible to all teams. How do I go about making it so that the billboardgui icon in each innocent player is only visible to players in my "killer" team?
