Hello, I wanna display the heigth of all players, but its showing only 1, and if server have more than 1 player, its broking (Not Updating Player Possition), here is my code
function createPlayerMarkers(towerHeight)
for _, player in pairs(players:GetPlayers()) do
local playerGui = player:WaitForChild("PlayerGui")
local marker = playerGui.HeightGui:FindFirstChild("PlayerMarker_" .. player.Name) --Add ID
if not marker then
--If We Cant Find Marker, Then Creating this
marker = Instance.new("ImageLabel")
marker.Name = "PlayerMarker_" .. player.Name --Add ID
marker.Image = players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48)
marker.BackgroundTransparency = 0
marker.Size = UDim2.new(0.031, 0, 0.058, 0)
marker.Parent = playerGui.HeightGui
end
-- Update Plr Pos
local char = workspace:FindFirstChild(player.Name)
if char then
local hrp = char:FindFirstChild("HumanoidRootPart")
if hrp then
local height = math.ceil(hrp.Position.Y)
--Possition UI
marker.Position = UDim2.new(0.94, 0, 0.532 - height / 440, 0)
end
end
end
end