-- Configuration local DELAY_TIME = 3 local SPHERE_COLOR = Color3.new(0, 0, 0) local OUTLINE_COLOR = Color3.new(1, 0, 0) local DISTANCE_AWAY = 50 local MAX_EFFECT_DISTANCE = 60 -- Distance where red tint starts local DECAL_ID = "121443940957962" local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local root = character:WaitForChild("HumanoidRootPart") local playerGui = player:WaitForChild("PlayerGui") local camera = workspace.CurrentCamera --- 1. THE FLASHING "RUN" TEXT --- local screenGui = Instance.new("ScreenGui", playerGui) local runText = Instance.new("TextLabel", screenGui) runText.Size = UDim2.new(1, 0, 0.2, 0) runText.Position = UDim2.new(0, 0, 0.4, 0) runText.BackgroundTransparency = 1 runText.Text = "RUN" runText.TextColor3 = Color3.new(1, 0, 0) runText.TextScaled = true runText.Font = Enum.Font.LuckiestGuy runText.Visible = false task.spawn(function() local startTime = tick() while tick() - startTime < DELAY_TIME do runText.Visible = not runText.Visible task.wait(0.2) end screenGui:Destroy() end) task.wait(DELAY_TIME) --- 2. THE SPHERE & EFFECTS --- local lighting = game:GetService("Lighting") local colorCorrection = Instance.new("ColorCorrectionEffect", lighting) colorCorrection.TintColor = Color3.new(1, 1, 1) local sphere = Instance.new("Part") sphere.Shape = Enum.PartType.Ball sphere.Size = Vector3.new(5, 5, 5) sphere.Color = SPHERE_COLOR sphere.Material = Enum.Material.Neon sphere.CanCollide = false sphere.Anchored = true sphere.Parent = workspace local face = Instance.new("Decal") face.Texture = "rbxassetid://" .. DECAL_ID face.Face = Enum.NormalId.Front face.Parent = sphere local highlight = Instance.new("Highlight") highlight.Adornee = sphere highlight.FillTransparency = 1 highlight.OutlineColor = OUTLINE_COLOR highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.Parent = sphere sphere.Position = root.Position + (root.CFrame.LookVector * -DISTANCE_AWAY) + Vector3.new(0, 2, 0) --- 3. MOVEMENT & DYNAMIC REDNESS LOGIC --- local connection connection = game:GetService("RunService").Heartbeat:Connect(function(dt) if not sphere or not sphere.Parent or humanoid.Health <= 0 then if sphere then sphere:Destroy() end if colorCorrection then colorCorrection:Destroy() end connection:Disconnect() return end -- KHÔNG ghi đè speed player - để player tự do thay đổi speed -- (ví dụ: bị effect làm chậm, dùng item tăng speed, v.v.) local targetPos = root.Position local currentPos = sphere.Position local playerSpeed = humanoid.WalkSpeed -- Lấy speed HIỆN TẠI của player -- Calculate distance local dist = (targetPos - currentPos).Magnitude -- Calculate sphere speed based on distance (using player's current speed) local sphereSpeed if dist > 30 then -- Xa: sphere nhanh hơn player 3 sphereSpeed = playerSpeed + 3 elseif dist < 15 then -- Gần: sphere chậm hơn player 5 sphereSpeed = playerSpeed - 5 else -- Bình thường: sphere bằng speed player sphereSpeed = playerSpeed end -- Đảm bảo sphere không chạy quá chậm hoặc âm sphereSpeed = math.max(sphereSpeed, 5) -- Move sphere towards player local direction = (targetPos - currentPos).Unit sphere.Position = currentPos + (direction * sphereSpeed * dt) sphere.CFrame = CFrame.lookAt(sphere.Position, targetPos) -- Calculate Intensity based on distance local intensity = math.clamp((MAX_EFFECT_DISTANCE - dist) / (MAX_EFFECT_DISTANCE - 4), 0, 1) -- Red Tint colorCorrection.TintColor = Color3.new(1, 1 - (intensity * 0.9), 1 - (intensity * 0.9)) -- Camera Shake if intensity > 0 then local shakePower = intensity * 0.6 camera.CFrame = camera.CFrame * CFrame.Angles( math.rad(math.random(-10, 10) / 10 * shakePower), math.rad(math.random(-10, 10) / 10 * shakePower), 0 ) end -- Kill check if dist < 4 then humanoid.Health = 0 sphere:Destroy() colorCorrection:Destroy() connection:Disconnect() end end)