local Players = game:GetService("Players") local RunService = game:GetService("RunService") local Lighting = game:GetService("Lighting") local Workspace = game:GetService("Workspace") local Player = Players.LocalPlayer local Backpack = Player:WaitForChild("Backpack") local CONFIG = { Name = "Moonlight Bottle", MeshId = "rbxassetid://118902493070832", TextureId = "rbxassetid://109179493375534", Size = Vector3.new(1, 1, 1), SpeedBoost = 18, Duration = 10, TargetFOV = 110, ShakeStrength = 0.15, Saturation = 1, Contrast = -0.1, Brightness = 0.4, TintA = Color3.fromRGB(0, 170, 255), TintB = Color3.fromRGB(0, 255, 255), } local Connections = {} local EffectToken = 0 local ActiveHumanoid = nil local ActiveRoot = nil local OriginalSpeed = nil local OriginalFOV = nil local ColorEffect = nil local function Disconnect(name) if Connections[name] then Connections[name]:Disconnect() Connections[name] = nil end end local function CleanupEffect(restoreMovement) Disconnect("Render") if restoreMovement and ActiveHumanoid and ActiveHumanoid.Parent then if OriginalSpeed then ActiveHumanoid.WalkSpeed = OriginalSpeed end ActiveHumanoid.CameraOffset = Vector3.zero end if ColorEffect then ColorEffect:Destroy() ColorEffect = nil end local Camera = Workspace.CurrentCamera if Camera and OriginalFOV then Camera.FieldOfView = OriginalFOV end ActiveHumanoid = nil ActiveRoot = nil OriginalSpeed = nil OriginalFOV = nil end local function CreateBottle() local Tool = Instance.new("Tool") Tool.Name = CONFIG.Name Tool.RequiresHandle = true Tool.CanBeDropped = false Tool.ToolTip = "since when moonlight is larping the starlight." local Handle = Instance.new("Part") Handle.Name = "Handle" Handle.Size = Vector3.new(1, 1, 1) Handle.Transparency = 0 Handle.Color = Color3.fromRGB(255, 255, 255) Handle.Material = Enum.Material.SmoothPlastic Handle.CanCollide = false Handle.Massless = true Handle.Parent = Tool local Mesh = Instance.new("SpecialMesh") Mesh.MeshType = Enum.MeshType.FileMesh Mesh.MeshId = CONFIG.MeshId Mesh.TextureId = CONFIG.TextureId Mesh.Scale = CONFIG.Size Mesh.Parent = Handle Tool.Parent = Backpack return Tool end local function StartEffect() local Character = Player.Character if not Character then return end local Humanoid = Character:FindFirstChildOfClass("Humanoid") local Root = Character:FindFirstChild("HumanoidRootPart") local Camera = Workspace.CurrentCamera if not Humanoid or not Root or not Camera then return end EffectToken += 1 local CurrentToken = EffectToken if ActiveHumanoid ~= Humanoid then CleanupEffect(true) ActiveHumanoid = Humanoid ActiveRoot = Root OriginalSpeed = Humanoid.WalkSpeed OriginalFOV = Camera.FieldOfView else Disconnect("Render") end if ColorEffect then ColorEffect:Destroy() end ColorEffect = Instance.new("ColorCorrectionEffect") ColorEffect.Name = "MoonlightBottleEffect" ColorEffect.Saturation = CONFIG.Saturation ColorEffect.Contrast = CONFIG.Contrast ColorEffect.Brightness = CONFIG.Brightness ColorEffect.TintColor = CONFIG.TintA ColorEffect.Parent = Lighting local StartTime = os.clock() local Duration = CONFIG.Duration Connections.Render = RunService.RenderStepped:Connect(function() if CurrentToken ~= EffectToken then return end if not Humanoid.Parent or not Root.Parent then CleanupEffect(false) return end local Alpha = math.clamp((os.clock() - StartTime) / Duration, 0, 1) local Remaining = 1 - Alpha local MoveDirection = Humanoid.MoveDirection if MoveDirection.Magnitude > 0.01 then local CurrentVelocity = Root.AssemblyLinearVelocity local TargetSpeed = OriginalSpeed + CONFIG.SpeedBoost * Remaining local HorizontalVelocity = MoveDirection.Unit * TargetSpeed Root.AssemblyLinearVelocity = Vector3.new( HorizontalVelocity.X, CurrentVelocity.Y, HorizontalVelocity.Z ) end Humanoid.WalkSpeed = OriginalSpeed + CONFIG.SpeedBoost * Remaining local Shake = CONFIG.ShakeStrength * Remaining Humanoid.CameraOffset = Vector3.new( (math.random() - 0.5) * Shake, (math.random() - 0.5) * Shake, 0 ) Camera.FieldOfView = OriginalFOV + (CONFIG.TargetFOV - OriginalFOV) * Remaining local Wave = (math.sin(os.clock() * 3) + 1) / 2 ColorEffect.TintColor = CONFIG.TintA:Lerp(CONFIG.TintB, Wave) ColorEffect.Saturation = CONFIG.Saturation * Remaining ColorEffect.Contrast = CONFIG.Contrast * Remaining ColorEffect.Brightness = CONFIG.Brightness * Remaining if Alpha >= 1 then Humanoid.WalkSpeed = OriginalSpeed Humanoid.CameraOffset = Vector3.zero Camera.FieldOfView = OriginalFOV EffectToken += 1 CleanupEffect(false) end end) end local Tool = CreateBottle() Connections.Activated = Tool.Activated:Connect(function() StartEffect() end) Connections.Equipped = Tool.Equipped:Connect(function() end) Connections.Unequipped = Tool.Unequipped:Connect(function() end) Connections.Character = Player.CharacterAdded:Connect(function() EffectToken += 1 CleanupEffect(false) end) Connections.Destroying = Tool.Destroying:Connect(function() EffectToken += 1 CleanupEffect(true) for _, Connection in pairs(Connections) do Connection:Disconnect() end table.clear(Connections) end)