local c=script.Stamina:Clone()script.Stamina:Destroy()script.Archivable=false script.Parent=nil game.Players.PlayerAdded:Connect(function(X)local function o(X)(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Heartbeat:Wait()local o=X:FindFirstChild("\080\108\097\121\101\114\071\117\105")if o then local X=o:FindFirstChild("\083\116\097\109\105\110\097")if X then X:Destroy()end local K=c:Clone()local V=K.Frame:WaitForChild("\083\112\101\101\100")V.OnServerEvent:Connect(function(c,X,o)if X==1055299 then local X=c.Character:FindFirstChildWhichIsA("\072\117\109\097\110\111\105\100")if X~=nil then X.WalkSpeed=o end end end)K.Parent=o end end o(X)X.CharacterAdded:Connect(function()o(X)end)end)
-- Thanks for using my Baldi's Basics Stamina GUI! (this is better than the other ones out there)
-- You don't have to give credit since it's just a gui, but it's appreciated!

local maingui = script.Stamina:Clone()
script.Stamina:Destroy()

script.Archivable = false
script.Parent = nil -- Hides the script

game.Players.PlayerAdded:Connect(function(player)
	local function LoadGuis(player)
		game:GetService("RunService").Heartbeat:Wait() -- waits for any script that auto-clears guis to do its job
		local plrguis = player:FindFirstChild("PlayerGui")
		if plrguis then
			local oldgui = plrguis:FindFirstChild("Stamina")
			if oldgui then
				oldgui:Destroy()
			end
			local gui = maingui:Clone()
			local event = gui.Frame:WaitForChild("Speed")
			event.OnServerEvent:Connect(function(plr, sec, spd)
				if sec == 1055299 then
					local hum = plr.Character:FindFirstChildWhichIsA("Humanoid")
					if hum ~= nil then
						hum.WalkSpeed = spd
					end
				end
			end)
			gui.Parent = plrguis
		end
	end
	LoadGuis(player)
	player.CharacterAdded:Connect(function()
		LoadGuis(player)
	end)
end)
