local players = game:GetService("Players") local player = players.LocalPlayer local connections = {} local function disconnect_all() for _, connection in ipairs(connections) do connection:Disconnect() end table.clear(connections) end local function update_stamina() local character = player.Character if not character then return end character:SetAttribute("StaminaDisabled", true) local player_gui = player:FindFirstChildOfClass("PlayerGui") local core_hud = player_gui and player_gui:FindFirstChild("CoreHud") local player_info = core_hud and core_hud:FindFirstChild("PlayerInfo") local bars = player_info and player_info:FindFirstChild("Bars") local stamina = bars and bars:FindFirstChild("Stamina") if not stamina then return end local amount = stamina:FindFirstChild("Amount") if amount and amount:IsA("TextLabel") then amount.Text = "100/100" end local bar = stamina:FindFirstChild("Bar") local clipping = bar and bar:FindFirstChild("Clipping") if clipping then clipping.Size = UDim2.fromScale(1, 1) local top = clipping:FindFirstChild("Top") if top then top.Size = UDim2.fromScale(1, 1) end end end local function bind_character(character) disconnect_all() character:SetAttribute("StaminaDisabled", true) table.insert(connections, character.AttributeChanged:Connect(function(attribute) if attribute == "StaminaDisabled" and character:GetAttribute("StaminaDisabled") ~= true then character:SetAttribute("StaminaDisabled", true) end end)) task.spawn(function() while character.Parent and player.Character == character do update_stamina() task.wait(0.1) end end) end if player.Character then bind_character(player.Character) end player.CharacterAdded:Connect(bind_character)