✓ Accepted answer
Local Script
local player = game.Players.LocalPlayer
local Teams = game:GetService("Teams")
wait(5)
for a, b in pairs(Teams:GetTeams()) do
if b == player.Team then
for i, obj in pairs(b:GetPlayers()) do
local character = workspace:FindFirstChild(obj.Name)
local Locate = Instance.new("Part")
Locate.Name = "Locator"
Locate.Parent = character
Locate.Anchored = false
Locate.CanCollide = false
Locate.Size = Vector3.new(3, 3, 3)
Locate.Transparency = 1
Locate.CFrame = character.Head.CFrame
local Weld = Instance.new("Weld")
Weld.Parent = Locate
Weld.Part0 = Locate
Weld.Part1 = character:WaitForChild("Head")
Weld.C0 = CFrame.new(0, -3, 0)
local Billboard = Instance.new("BillboardGui")
Billboard.Name = "DisplayDot"
Billboard.Parent = Locate
Billboard.AlwaysOnTop = true
Billboard.Adornee = Locate
Billboard.Size = UDim2.new(1, 0, 1, 0)
local ImageLabel = Instance.new("ImageLabel")
ImageLabel.Name = "Dot"
ImageLabel.Parent = Billboard
ImageLabel.Size = UDim2.new(1, 0, 1, 0)
ImageLabel.ImageColor3 = Color3.fromRGB(0, 0, 255)
ImageLabel.Image = "rbxassetid://1435770904"
ImageLabel.BackgroundTransparency = 1
wait()
end
end
wait()
end
PREVIOUS ERRORS: The errors you had were related to case sensitive material
"player.team" should be "player.Team"
"instance.new()" should be "Instance.new()"
Scale is not a valid Property of a Part, but Size is
EXPLANATION OF VARIABLES
Teams:GetTeams() is used to get the teams from the game in a table (the for loop iterates over these)
When the Team matches the player's team, a second table Team:GetPlayers()is used to get all players on that team
Welds make sure the parts in the Part1 and Part0 Properties are connected and stay at an offset set by the C0 Property.
The BillboardGui will make the ImageLabel Circle appear above a player's head (the offset of this is taken from the Adornee Property, as the Locate is welded to the player's Head)
1 comment
Lua is case sensitive, so Instance.new(), player.Team, etc should be used. As for the question, I would unanchor the part and instead use a weld connected to the HumanoidRootPart instead. From there insert a BillboardGui -> ImgLabel into the part and set AlwaysOnTop to true.