Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local client = game.Players.LocalPlayer
- local configuration = {
- USE_TEAM_COLOURS = true, --If this is enabled, player outlines will be based on team colours instead of the colours below
- ALLY_FILL_COLOUR = Color3.fromRGB(131, 212, 255), --Fill colour for allies
- ALLY_FILL_TRANSPARENCY = 0.4, --Fill transparency for allies
- ALLY_OUTLINE_COLOUR = Color3.fromRGB(42, 163, 255), --Outline colour for allies
- ALLY_OUTLINE_TRANSPARENCY = 0, --Outline transparency for allies
- ENEMY_FILL_COLOUR = Color3.fromRGB(255, 82, 85), --Fill colour for enemies
- ENEMY_FILL_TRANSPARENCY = 1, --Fill transparency for enemies
- ENEMY_OUTLINE_COLOUR = Color3.fromRGB(208, 32, 32), --Outline colour for enemies
- ENEMY_OUTLINE_TRANSPARENCY = 0, --Outline transparency for enemies
- }
- function handleHighlight(highlightObject, plr)
- if plr.Team == client.Team then --This means the player is an ally
- highlightObject.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- highlightObject.FillTransparency = configuration.ALLY_FILL_TRANSPARENCY
- highlightObject.OutlineTransparency = configuration.ALLY_OUTLINE_TRANSPARENCY
- if configuration.USE_TEAM_COLOURS then
- highlightObject.FillColor = plr.TeamColor.Color
- highlightObject.OutlineColor = plr.TeamColor.Color
- else
- highlightObject.FillColor = configuration.ALLY_FILL_COLOUR
- highlightObject.OutlineColor = configuration.ALLY_OUTLINE_COLOUR
- end
- else --This means the player is an enemy
- highlightObject.DepthMode = Enum.HighlightDepthMode.Occluded
- highlightObject.FillTransparency = configuration.ENEMY_FILL_TRANSPARENCY
- highlightObject.OutlineTransparency = configuration.ENEMY_OUTLINE_TRANSPARENCY
- if configuration.USE_TEAM_COLOURS then
- highlightObject.FillColor = plr.TeamColor.Color
- highlightObject.OutlineColor = plr.TeamColor.Color
- else
- highlightObject.FillColor = configuration.ENEMY_FILL_COLOUR
- highlightObject.OutlineColor = configuration.ENEMY_OUTLINE_COLOUR
- end
- end
- end
- function handleChar(plr)
- local char = plr.Character or plr.CharacterAdded:Wait()
- local highlightObject = plr.Character:FindFirstChild("TEAM HIGHLIGHTER") or Instance.new("Highlight")
- highlightObject.Name = "TEAM HIGHLIGHTER"
- handleHighlight(highlightObject, plr)
- highlightObject.Parent = char
- end
- function handlePlr(plr)
- if plr == client then return end
- if plr.Character then
- handleChar(plr)
- end
- plr.CharacterAdded:Connect(function(char)
- handleChar(plr)
- end)
- plr:GetPropertyChangedSignal("Team"):Connect(function()
- handleChar(plr)
- end)
- end
- game.Players.PlayerAdded:Connect(handlePlr)
- for i, plr in pairs(game.Players:GetPlayers()) do
- handlePlr(plr)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement