-- 🔥 Rayfield
local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

local Window = Rayfield:CreateWindow({
   Name = "🔥 마인민이 핵 V1(라이벌용)",
   LoadingTitle = "로딩중...",
   LoadingSubtitle = "마인민이 구독!",
   ConfigurationSaving = { Enabled = false }
})

-- =====================
-- 탭
-- =====================
local MainTab = Window:CreateTab("메인")
local PlayerTab = Window:CreateTab("플레이어")
local WinTab = Window:CreateTab("레이지봇")

-- =====================
-- 서비스
-- =====================
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

-- =====================
-- 상태값
-- =====================
local Fly, FlySpeed = false, 50
local Noclip = false

local Aim = false
local AimPart = "Head"
local Smooth = 0.15
local RightClick = false
local LockedTarget = nil
local FOV = 200

-- 오토봇(트리거봇) 변수
local TriggerBot = false
local TriggerDelay = 0.1
local lastShot = 0

local Speed = 16
local Invisible = false

-- TP
local TPPlayer = nil
local TPInfinite = false
local ESP = false
local ESPObjects = {}

-- =====================
-- 🎯 FOV 원
-- =====================
local circle = Drawing.new("Circle")
circle.Radius = FOV
circle.Thickness = 2
circle.Filled = false
circle.Visible = true

RunService.RenderStepped:Connect(function()
   circle.Position = UIS:GetMouseLocation()
   circle.Radius = FOV
end)

-- =====================
-- UI
-- =====================

-- 🚀 FLY
MainTab:CreateToggle({
   Name = "플라이",
   CurrentValue = false,
   Callback = function(v) Fly = v end
})

MainTab:CreateSlider({
   Name = "플라이 속도",
   Range = {10,200},
   Increment = 5,
   CurrentValue = 50,
   Callback = function(v) FlySpeed = v end
})



MainTab:CreateToggle({
   Name = "ESP",
   CurrentValue = false,
   Callback = function(v)
      ESP = v

      -- 끄면 삭제
      if not v then
         for p,gui in pairs(ESPObjects) do
            if gui then gui:Destroy() end
            ESPObjects[p] = nil
         end
      end
   end
})



-- 🧱 NOCLIP
MainTab:CreateToggle({
   Name = "노클립",
   CurrentValue = false,
   Callback = function(v) Noclip = v end
})


-----
MainTab:CreateToggle({
   Name = "내 몸 투명",
   CurrentValue = false,
   Callback = function(v)
      Invisible = v
   end
})
-- =====================
-- 🔫 총기 쿨다운 줄이기
-- =====================
MainTab:CreateButton({
   Name = "총기 쿨다운 줄이기",
   Callback = function()
      local ReplicatedStorage = game:GetService("ReplicatedStorage")

      local weaponDataCache
      local modulesFolder = ReplicatedStorage:FindFirstChild("Modules")
      if modulesFolder then
         local possibleNames = {"ItemLibrary", "WeaponStats", "Items", "WeaponData", "Weapons"}
         for _, name in ipairs(possibleNames) do
            local found = modulesFolder:FindFirstChild(name)
            if found then
               weaponDataCache = require(found)
               break
            end
         end
      end

      if weaponDataCache and weaponDataCache.Items then
         for _, stats in pairs(weaponDataCache.Items) do
            if stats.ShootCooldown then stats.ShootCooldown = 0 end
            if stats.ShootBurstCooldown then stats.ShootBurstCooldown = 0 end
            if stats.AttackCooldown then stats.AttackCooldown = 0 end
            if stats.HeavyAttackCooldown then stats.HeavyAttackCooldown = 0 end
            if stats.Cooldown then stats.Cooldown = 0 end
            if stats.DeflectCooldown then stats.DeflectCooldown = 0 end
            if stats.DashCooldown then stats.DashCooldown = 0 end
            if stats.BuildCooldown then stats.BuildCooldown = 0 end
            if stats.SpinCooldown then stats.SpinCooldown = 0 end
            if stats.AirblastCooldown then stats.AirblastCooldown = 0 end
            if stats.QuickShotCooldown then stats.QuickShotCooldown = 0 end
            if stats.TransitionCooldown then stats.TransitionCooldown = 0 end
            if stats.ReloadTime then stats.ReloadTime = 0.01 end
         end
         Rayfield:Notify({Title = "총기 쿨다운", Content = "모든 무기 쿨다운이 제거되었습니다!", Duration = 3})
      else
         Rayfield:Notify({Title = "총기 쿨다운", Content = "무기 데이터를 찾을 수 없습니다.", Duration = 3})
      end
   end
})

-- ⚡ SPEED
PlayerTab:CreateSlider({
   Name = "스피드",
   Range = {16,200},
   Increment = 1,
   CurrentValue = 16,
   Callback = function(v)
      Speed = v
      local char = player.Character
      if char and char:FindFirstChild("Humanoid") then
         char.Humanoid.WalkSpeed = v
      end
   end
})


-- 🎯 AIM
PlayerTab:CreateToggle({
   Name = "에임 ON/OFF",
   CurrentValue = false,
   Callback = function(v) Aim = v end
})

PlayerTab:CreateDropdown({
   Name = "에임 위치",
   Options = {"Head","Body"},
   CurrentOption = {"Head"},
   Callback = function(v)
      AimPart = (v[1] == "Head") and "Head" or "HumanoidRootPart"
   end
})

PlayerTab:CreateSlider({
   Name = "부드러움",
   Range = {1,100},
   Increment = 1,
   CurrentValue = 15,
   Callback = function(v) Smooth = v/100 end
})

PlayerTab:CreateSlider({
   Name = "FOV",
   Range = {50,500},
   Increment = 10,
   CurrentValue = 200,
   Callback = function(v) FOV = v end
})

-- 🔫 트리거봇
PlayerTab:CreateToggle({
   Name = "오토봇",
   CurrentValue = false,
   Callback = function(v) TriggerBot = v end
})

PlayerTab:CreateSlider({
   Name = "발사 속도",
   Range = {0.05,0.5},
   Increment = 0.01,
   CurrentValue = 0.1,
   Callback = function(v) TriggerDelay = v end
})

-- =====================
-- 🔥 TP
-- =====================
-- =====================
-- 🔥 TP
-- =====================
local function GetPlayers()
   local t = {}
   for _,p in pairs(Players:GetPlayers()) do
      if p ~= player then table.insert(t,p.Name) end
   end
   return t
end

PlayerTab:CreateDropdown({
   Name = "TP 대상",
   Options = GetPlayers(),
   CurrentOption = {},
   Callback = function(v)
      TPPlayer = Players:FindFirstChild(v[1])
   end
})


PlayerTab:CreateButton({
   Name = "한번 TP",
   Callback = function()
      if TPPlayer and TPPlayer.Character and player.Character then
         local hrp = player.Character:FindFirstChild("HumanoidRootPart")
         local target = TPPlayer.Character:FindFirstChild("HumanoidRootPart")
         if hrp and target then
            hrp.CFrame = target.CFrame + Vector3.new(0,2,0)
         end
      end
   end
})

PlayerTab:CreateToggle({
   Name = "무한 TP",
   CurrentValue = false,
   Callback = function(v) TPInfinite = v end
})

-- =====================
-- 🎮 입력
-- =====================
UIS.InputBegan:Connect(function(i,gp)
   if gp then return end

   if i.UserInputType == Enum.UserInputType.MouseButton2 then
      RightClick = true
      LockedTarget = nil
   end
end)

UIS.InputEnded:Connect(function(i)
   if i.UserInputType == Enum.UserInputType.MouseButton2 then
      RightClick = false
      LockedTarget = nil
   end
end)

-- =====================
-- 🎯 타겟 찾기
-- =====================
-- 2. 가장 가까운 적을 찾는 함수 (화면 중앙 기준)
local function GetClosest()
   local closest, dist = nil, math.huge

   for _, p in pairs(Players:GetPlayers()) do
      if p ~= player and p.Character and p.Character:FindFirstChild(AimPart) then
         local pos, ons = camera:WorldToViewportPoint(p.Character[AimPart].Position)
         if ons then
            -- 마우스 커서(화면 중앙)와 적 사이의 거리 계산
            local d = (Vector2.new(pos.X, pos.Y) - UIS:GetMouseLocation()).Magnitude
            if d < dist and d < FOV then
               dist = d
               closest = p
            end
         end
      end
   end

   return closest
end


-- =====================
-- 🧠 메인 루프
-- =====================
RunService.RenderStepped:Connect(function()
   local char = player.Character
   if not char then return end

   local hrp = char:FindFirstChild("HumanoidRootPart")
   local hum = char:FindFirstChild("Humanoid")
   if not hrp or not hum then return end

   -- 🚀 FLY (Space ↑ / Shift ↓ 완전 고정)
if Fly then
   if not hrp:FindFirstChild("BP") then
      local bp = Instance.new("BodyPosition", hrp)
      bp.Name = "BP"
      bp.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
      bp.Position = hrp.Position

      local bg = Instance.new("BodyGyro", hrp)
      bg.Name = "BG"
      bg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
   end

   local bp = hrp:FindFirstChild("BP")
   local bg = hrp:FindFirstChild("BG")

   local move = Vector3.new(0,0,0)

   -- 앞뒤좌우
   if UIS:IsKeyDown(Enum.KeyCode.W) then
      move += camera.CFrame.LookVector
   end
   if UIS:IsKeyDown(Enum.KeyCode.S) then
      move -= camera.CFrame.LookVector
   end
   if UIS:IsKeyDown(Enum.KeyCode.A) then
      move -= camera.CFrame.RightVector
   end
   if UIS:IsKeyDown(Enum.KeyCode.D) then
      move += camera.CFrame.RightVector
   end

   -- 🔥 위/아래 (중요)
   if UIS:IsKeyDown(Enum.KeyCode.Space) then
      move += Vector3.new(0,1,0)
   end
   if UIS:IsKeyDown(Enum.KeyCode.LeftShift) then
      move -= Vector3.new(0,1,0)
   end

   if move.Magnitude > 0 then
      bp.Position = hrp.Position + move.Unit * FlySpeed
   else
      bp.Position = hrp.Position
   end

   bg.CFrame = camera.CFrame
else
   if hrp:FindFirstChild("BP") then hrp.BP:Destroy() end
   if hrp:FindFirstChild("BG") then hrp.BG:Destroy() end
end

   -- 🧱 NOCLIP
   for _,v in pairs(char:GetDescendants()) do
      if v:IsA("BasePart") then
         v.CanCollide = not Noclip
      end
   end


        -- 🔴 ESP
if ESP then
   for _,p in pairs(Players:GetPlayers()) do
      if p ~= player and p.Character and p.Character:FindFirstChild("Head") then

         local hum2 = p.Character:FindFirstChildOfClass("Humanoid")
         local hrp2 = p.Character:FindFirstChild("HumanoidRootPart")
         if not hum2 or not hrp2 then continue end

         if not ESPObjects[p] then
            local bill = Instance.new("BillboardGui")
            bill.Name = "ESP_"..p.Name
            bill.Size = UDim2.new(0,200,0,50)
            bill.Adornee = p.Character.Head
            bill.AlwaysOnTop = true
            bill.Parent = p.Character

            local text = Instance.new("TextLabel")
            text.Size = UDim2.new(1,0,1,0)
            text.BackgroundTransparency = 1
            text.TextStrokeTransparency = 0
            text.TextColor3 = Color3.fromRGB(255,255,255)
            text.TextScaled = true
            text.Parent = bill

            ESPObjects[p] = bill
         end

         local bill = ESPObjects[p]
         local label = bill and bill:FindFirstChildOfClass("TextLabel")

         if label then
            local dist = (hrp.Position - hrp2.Position).Magnitude
            local hp = math.floor(hum2.Health)

            label.Text = p.Name.." | "..math.floor(dist).."m | "..hp.."HP"
         end
      end
   end
end



        -- 👻 투명
for _,v in pairs(char:GetDescendants()) do
   if v:IsA("BasePart") then
      v.LocalTransparencyModifier = Invisible and 1 or 0
   end
end


        
   -- 🎯 AIM (락온 유지)
-----------------------------------------------------------------
   -- [기능 1] 🎯 에임봇 로직 (우클릭을 누르고 있을 때만 작동)
   -----------------------------------------------------------------
   if Aim and RightClick then
      if not LockedTarget then
         LockedTarget = GetClosest()
      end

      if LockedTarget and LockedTarget.Character and LockedTarget.Character:FindFirstChild(AimPart) then
         local targetPos = LockedTarget.Character[AimPart].Position
         
         -- 연사 시 탄이 튀는 문제를 막기 위해 Lerp 속도를 강하게 주거나 즉시 고정합니다.
         -- 부드럽게 움직이고 싶다면 0.5 값을 낮추세요 (낮출수록 반동 때문에 에임이 튑니다).
         camera.CFrame = camera.CFrame:Lerp(CFrame.new(camera.CFrame.Position, targetPos), Smooth)
      end
   end

         -- 🔫 트리거봇
if TriggerBot and (tick() - lastShot > TriggerDelay) then
      -- 현재 내 화면 중앙에서 가장 가까운 적을 탐색
      local autoTarget = GetClosest()
      
      if autoTarget and autoTarget.Character and autoTarget.Character:FindFirstChild(AimPart) then
         local targetPos = autoTarget.Character[AimPart].Position
         local screenPos, onScreen = camera:WorldToViewportPoint(targetPos)
         
         if onScreen then
            local mouseLoc = UIS:GetMouseLocation()
            local distanceToCursor = (Vector2.new(screenPos.X, screenPos.Y) - mouseLoc).Magnitude
            
            -- 적이 설정한 FOV 범위 내에 있고, 
            -- 마우스 크로스헤어(중앙)와 적의 거리가 25픽셀 이하로 조준되었을 때 자동 연사

            if distanceToCursor < 25 then 
               lastShot = tick()
               if mouse1click then
                  mouse1click()
               end
            end
         end
      end
   end

   -- 🔥 무한 TP (루프 내부로 정상 편입)
   if TPInfinite and TPPlayer and TPPlayer.Character then
      local target = TPPlayer.Character:FindFirstChild("HumanoidRootPart")
      if target then
         hrp.CFrame = target.CFrame + Vector3.new(0,2,0)
      end
   end

   -- ⚡ Speed 유지 (루프 내부로 정상 편입)
   if hum.WalkSpeed ~= Speed then
      hum.WalkSpeed = Speed
   end
end) -- ◀ 메인 루프는 여기서 딱 한 번만 닫혀야 합니다.

-- 🔁 리스폰
player.CharacterAdded:Connect(function(c)
   c:WaitForChild("Humanoid").WalkSpeed = Speed
end)


player.CharacterAdded:Connect(function()
   for p,gui in pairs(ESPObjects) do
      if gui then gui:Destroy() end
      ESPObjects[p] = nil
   end
end)


-- =====================
-- 🔥 렉 이동 루프 (추가)
-- =====================
-- =====================
-- 🔥 렉 이동 루프 (추가)
-- =====================
local TargetPlayer = nil
local Loop = false

-- 1. 대상 선택 UI (실시간 즉시 실행 함수 적용)
PlayerTab:CreateDropdown({
   Name = "렉 이동 대상",
   Options = (function()
      local t = {}
      for _, p in pairs(Players:GetPlayers()) do
         if p ~= player then 
            table.insert(t, p.Name) 
         end
      end
      return t
   end)(),
   CurrentOption = {},
   Callback = function(v)
      if v and v[1] then
         TargetPlayer = Players:FindFirstChild(v[1])
      else
         TargetPlayer = nil
      end
   end
})

-- 2. 중복되던 드롭다운을 삭제하고 사라졌던 토글 기능을 다시 정상 배치했습니다.
PlayerTab:CreateToggle({
   Name = "렉 이동 루프",
   CurrentValue = false,
   Callback = function(v)
      Loop = v

      if v then
         if _G.LagLoopRunning then return end
         _G.LagLoopRunning = true

         task.spawn(function()
            while Loop do
               task.wait(0.01) -- 무한 루프 크래시 방지
               
               if not TargetPlayer then continue end -- 대상이 없으면 안전하게 통과

               local char = player.Character
               local hrp = char and char:FindFirstChild("HumanoidRootPart")

               local targetChar = TargetPlayer.Character
               local targetHRP = targetChar and targetChar:FindFirstChild("HumanoidRootPart")

               if hrp and targetHRP then
                  -- 🔥 멀리 이동 (렌더 밖)
                  hrp.CFrame = CFrame.new(0, 100000, 0)

                  -- 🔥 0.01초 후 복귀
                  task.wait(0.01)

                  hrp.CFrame = targetHRP.CFrame + Vector3.new(0,2,0)
               end
            end
            _G.LagLoopRunning = false -- 루프 종료 시 플래그 해제
         end)
      end
   end
})






player.CharacterAdded:Connect(function()
   Rayfield:Notify({
      Title = "리스폰",
      Content = "다시 사용 가능",
      Duration = 2
   })
end)

-- ==========================================
-- 1. 서비스 및 기본 변수 초기화
-- ==========================================
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local VirtualInputManager = game:GetService("VirtualInputManager") -- 🌟 키보드 입력 주입용 서비스
local LocalPlayer = Players.LocalPlayer
local camera = workspace.CurrentCamera

-- 제어 변수
local RageEnabled = false
local AutoSpaceEnabled = false -- 🌟 자동 스페이스바 토글 변수
local Whitelist = {}
local TargetPlayer = nil
local AimPart = "Head"

-- ==========================================
-- 2. 서버 유저 목록 리프레시 함수
-- ==========================================
local function getPlayerNames()
    local names = {}
    for _, p in pairs(Players:GetPlayers()) do
        if p ~= LocalPlayer then
            table.insert(names, p.Name)
        end
    end
    return names
end

-- ==========================================
-- 3. 💀 사망 시 0.5초 뒤 스페이스바 자동 입력 로직
-- ==========================================
local function listenToDeath(character)
    local humanoid = character:WaitForChild("Humanoid", 5)
    if humanoid then
        humanoid.Died:Connect(function()
            -- 자동 스페이스바 기능이 켜져있을 때만 작동
            if AutoSpaceEnabled then
                task.wait(0.5) -- 0.5초 대기
                
                -- 스페이스바(Enum.KeyCode.Space) 강제 입력 및 해제
                VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Space, false, game)
                task.wait(0.05)
                VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Space, false, game)
            end
        end)
    end
end

-- 최초 캐릭터 및 리스폰 시 사망 감지 연결
if LocalPlayer.Character then listenToDeath(LocalPlayer.Character) end
LocalPlayer.CharacterAdded:Connect(function(newCharacter) listenToDeath(newCharacter) end)

-- ==========================================
-- 4. Rayfield GUI UI 구성
-- ==========================================
-- [레이지 봇 On/Off 토글]
local Toggle1 = WinTab:CreateToggle({
   Name = "Rage TP Bot (Back & Head Lock)",
   CurrentValue = false,
   Flag = "RageToggle",
   Callback = function(Value)
      RageEnabled = Value
      if Value then
          Rayfield:Notify({Title = "Rage Bot", Content = "레이지 봇 활성화!", Duration = 2})
      else
          TargetPlayer = nil
          Rayfield:Notify({Title = "Rage Bot", Content = "레이지 봇 비활성화.", Duration = 2})
      end
   end,
})

-- [🌟 자동 스페이스바 On/Off 토글]
local Toggle2 = WinTab:CreateToggle({
   Name = "Auto Spacebar on Death (0.5s)",
   CurrentValue = false,
   Flag = "AutoSpaceToggle",
   Callback = function(Value)
      AutoSpaceEnabled = Value
      if Value then
          Rayfield:Notify({Title = "Auto Space", Content = "사망 시 0.5초 후 스페이스바 작동 활성화!", Duration = 2})
      else
          Rayfield:Notify({Title = "Auto Space", Content = "자동 스페이스바 비활성화.", Duration = 2})
      end
   end,
})

-- [예외 유저 선택 Dropdown]
local Dropdown = WinTab:CreateDropdown({
   Name = "Exclude From Target (적에서 제외할 사람)",
   Options = getPlayerNames(),
   CurrentOption = {},
   MultipleOptions = true,
   Flag = "WhitelistDropdown",
   Callback = function(Options)
       Whitelist = Options
   end,
})

Players.PlayerAdded:Connect(function() Dropdown:Refresh(getPlayerNames(), true) end)
Players.PlayerRemoving:Connect(function() Dropdown:Refresh(getPlayerNames(), true) end)

-- ==========================================
-- 5. 타겟 탐색 함수
-- ==========================================
local function getClosestPlayer()
    local closestPlayer = nil
    local shortestDistance = math.huge
    
    for _, player in pairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and not table.find(Whitelist, player.Name) then
            if player.Character and player.Character:FindFirstChild("HumanoidRootPart") and player.Character:FindFirstChild("Humanoid") then
                if player.Character.Humanoid.Health > 0 then
                    local distance = (LocalPlayer.Character.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude
                    if distance < shortestDistance then
                        shortestDistance = distance
                        closestPlayer = player
                    end
                end
            end
        end
    end
    return closestPlayer
end

-- ==========================================
-- 6. 메인 루프 (초고속 TP + 자동 에임 + 트리거봇)
-- ==========================================
RunService.RenderStepped:Connect(function()
    if not RageEnabled then return end
    
    local myRoot = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    if not myRoot then return end
    
    TargetPlayer = getClosestPlayer()
    if not TargetPlayer or not TargetPlayer.Character then return end
    
    local enemyRoot = TargetPlayer.Character:FindFirstChild("HumanoidRootPart")
    local enemyHead = TargetPlayer.Character:FindFirstChild("Head")
    local enemyHumanoid = TargetPlayer.Character:FindFirstChild("Humanoid")
    
    if enemyRoot and enemyHead and enemyHumanoid and enemyHumanoid.Health > 0 then
        -- 5스터드 미세 진동 TP
        local backOffset = -enemyRoot.CFrame.LookVector * 3.5
        local jitterX = math.random(-50, 50) / 100
        local jitterY = math.random(-20, 40) / 100
        local jitterZ = math.random(-50, 50) / 100
        local targetPosition = enemyRoot.Position + backOffset + Vector3.new(jitterX, jitterY, jitterZ)
        
        myRoot.CFrame = CFrame.new(targetPosition, enemyHead.Position)
        camera.CFrame = CFrame.new(camera.CFrame.Position, enemyHead.Position)
        
        -- 트리거봇
        local currentTool = LocalPlayer.Character:FindFirstChildOfClass("Tool")
        if currentTool then
            currentTool:Activate()
        end
    end
end)


-- =====================
-- 서비스 및 변수 정의
-- =====================
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local UIS = game:GetService("UserInputService")
local Debris = game:GetService("Debris")
local TweenService = game:GetService("TweenService")

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

-- 기능 상시 활성화 고정
local SnowEnabled = true
local IsMouseDown = false 

-- =====================
-- 1. [강제 렌더링] 눈덩이 생성 시스템 (크기 1.0)
-- =====================
RunService.Heartbeat:Connect(function()
    if SnowEnabled and math.random(1, 2) == 1 then 
        local snow = Instance.new("Part")
        snow.Shape = Enum.PartType.Ball
        snow.Size = Vector3.new(1, 1, 1) -- 딱 보기 좋은 크기 1.0
        snow.Color = Color3.fromRGB(255, 255, 255)
        snow.Material = Enum.Material.Ice
        snow.Anchored = false
        snow.CanCollide = false
        snow.CanQuery = false 
        
        -- 카메라 주변 하늘에서 넓게 생성
        local pos = camera.CFrame.Position + Vector3.new(math.random(-150, 150), 60, math.random(-150, 150))
        snow.CFrame = CFrame.new(pos)
        snow.Parent = workspace
        
        local bv = Instance.new("BodyVelocity")
        bv.Velocity = Vector3.new(math.random(-5, 5), -15, math.random(-5, 5))
        bv.Parent = snow
        
        Debris:AddItem(snow, 6)
    end
end)


-- =====================
-- 3. 고급 셰이더 효과 함수
-- =====================
local function applyShader()
    Lighting.ClockTime = 14
    Lighting.Brightness = 3.5
    Lighting.GlobalShadows = true
    Lighting.Ambient = Color3.fromRGB(30, 30, 35)
    Lighting.OutdoorAmbient = Color3.fromRGB(45, 50, 60)
    
    local fx = {"ShaderBloom", "ShaderCC", "ShaderRays", "ShaderAtmos"}
    for _, name in pairs(fx) do if not Lighting:FindFirstChild(name) then 
        if name == "ShaderBloom" then Instance.new("BloomEffect", Lighting).Name = name
        elseif name == "ShaderCC" then Instance.new("ColorCorrectionEffect", Lighting).Name = name
        elseif name == "ShaderRays" then Instance.new("SunRaysEffect", Lighting).Name = name
        elseif name == "ShaderAtmos" then Instance.new("Atmosphere", Lighting).Name = name end
    end end
end

task.spawn(applyShader)

-- =====================
-- 4. 상시 연사 루프
-- =====================
RunService.RenderStepped:Connect(function()
   if BeamEnabled and IsMouseDown then
      local origin = camera.CFrame.Position
      local targetDirection = camera.CFrame.LookVector
      local result = workspace:Raycast(origin, targetDirection * 1000, RaycastParams.new())
      local targetPosition = result and result.Position or (origin + targetDirection * 1000)
      task.spawn(createYellowBeam, origin, targetPosition)
   end
end)

-- =====================
-- 5. 마우스/터치 인식
-- =====================
UIS.InputBegan:Connect(function(input, gp)
   if gp then return end
   if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
      IsMouseDown = true
   end
end)

UIS.InputEnded:Connect(function(input)
   if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
      IsMouseDown = false
   end
end)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: