local player = game.Players.LocalPlayer -- متغيرات عامة local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") -- السرعات local speedValues = {30, 16, 8} local pressCount = 0 local tiredTextLabel = nil local timer = 0 -- متغير لحساب الوقت local isTired = false -- لمنع تكرار حالة التعب -- وظيفة لإعادة تهيئة المتغيرات عند إعادة إحياء اللاعب local function resetCharacter() character = player.Character or player.CharacterAdded:Wait() humanoid = character:WaitForChild("Humanoid") -- إزالة أي نص تعب قديم if tiredTextLabel then tiredTextLabel:Destroy() tiredTextLabel = nil end pressCount = 0 timer = 0 isTired = false end -- الدالة الخاصة بالضغط على X local function onKeyPress(input) if input.KeyCode == Enum.KeyCode.X then -- زيادة عدد الضغطات pressCount = pressCount + 1 -- تغيير السرعة حسب عدد الضغطات humanoid.WalkSpeed = speedValues[(pressCount - 1) % #speedValues + 1] -- عند الوصول إلى الحد الأقصى من السرعات، يبدأ العداد if pressCount == #speedValues and timer == 0 then timer = 120 -- 120 ثانية قبل التعب isTired = false -- إعادة ضبط حالة التعب end end end -- تحديث الوقت باستخدام Heartbeat لضمان دقة عالية game:GetService("RunService").Heartbeat:Connect(function(deltaTime) if timer > 0 then timer = timer - deltaTime if timer <= 0 and not isTired then isTired = true -- وضع اللاعب في حالة التعب -- إنشاء نص التعب العائم tiredTextLabel = Instance.new("BillboardGui") tiredTextLabel.Parent = character.Head tiredTextLabel.Adornee = character.Head tiredTextLabel.Size = UDim2.new(0, 200, 0, 50) tiredTextLabel.StudsOffset = Vector3.new(0, 3, 0) local textLabel = Instance.new("TextLabel") textLabel.Parent = tiredTextLabel textLabel.Size = UDim2.new(1, 0, 1, 0) textLabel.Text = "أنا متعب" textLabel.TextSize = 24 textLabel.Font = Enum.Font.SourceSansBold textLabel.TextColor3 = Color3.fromRGB(255, 0, 0) textLabel.BackgroundTransparency = 1 humanoid.WalkSpeed = 4 -- تقليل السرعة بعد التعب end end end) -- الاستماع للضغط على المفتاح X game:GetService("UserInputService").InputBegan:Connect(onKeyPress) -- إعادة تهيئة المتغيرات عند موت اللاعب أو إعادة إحيائه player.CharacterAdded:Connect(resetCharacter)