local Players = game:GetService("Players") local RunService = game:GetService("RunService") local function ApplyNameTag(player) local function setup(char) local head = char:WaitForChild("Head", 10) local hum = char:WaitForChild("Humanoid", 10) if head and hum then -- On crée le Billboard local billboard = Instance.new("BillboardGui") billboard.Name = "NameTag" billboard.Parent = head billboard.Size = UDim2.new(0, 200, 0, 50) billboard.StudsOffset = Vector3.new(0, 3, 0) billboard.AlwaysOnTop = true -- On crée le texte local label = Instance.new("TextLabel") label.Parent = billboard label.Size = UDim2.new(1, 0, 1, 0) label.BackgroundTransparency = 1 label.Text = player.DisplayName or player.Name label.TextColor3 = Color3.new(1, 1, 1) label.TextStrokeTransparency = 0 label.Font = Enum.Font.SourceSansBold label.TextSize = 18 -- BOUCLE DE VÉRIFICATION STRICTE local connection connection = RunService.RenderStepped:Connect(function() -- Si le perso n'existe plus, si la vie est à 0, ou si l'humanoid est désactivé if not char or not char:Parent() or hum.Health <= 0 or hum:GetState() == Enum.HumanoidStateType.Dead then billboard:Destroy() connection:Disconnect() end end) -- Sécurité supplémentaire : détruire si le corps est supprimé char.AncestryChanged:Connect(function() if not char:IsDescendantOf(workspace) then billboard:Destroy() if connection then connection:Disconnect() end end end) end end player.CharacterAdded:Connect(setup) if player.Character then setup(player.Character) end end -- Activer pour tout le monde for _, p in pairs(Players:GetPlayers()) do if p ~= Players.LocalPlayer then ApplyNameTag(p) end end Players.PlayerAdded:Connect(ApplyNameTag)