local t=script.Stamina:Clone()script.Stamina:Destroy()script.Archivable=false script.Parent=nil game.Players.PlayerAdded:Connect(function(o)local function e(o)(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Heartbeat:Wait()local e=o:FindFirstChild("\080\108\097\121\101\114\071\117\105")if e then local o=e:FindFirstChild("\083\116\097\109\105\110\097")if o then o:Destroy()end local N=t:Clone()local r=N.Frame:WaitForChild("\083\112\101\101\100")r.OnServerEvent:Connect(function(t,o,e)if o==1055299 then local o=t.Character:FindFirstChildWhichIsA("\072\117\109\097\110\111\105\100")if o~=nil then o.WalkSpeed=e end end end)N.Parent=e end end e(o)o.CharacterAdded:Connect(function()e(o)end)end)


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)
