SonicSPEED
Key RequiredUniversal

SonicSPEED

Universal ScriptScritp123Scritp123 313 views 56 executesUpdated Dec 28, 2025
Unrated
00
Lua Script•894 lines (30638 chars)
-- Sonic Güç Scripti (Boost: Güç Biriktirme Sistemi)
-- Boost'a basılı tutunca güç birikir, bırakınca ANİ hızlanma

-- Yükleme mesajı
print("🎮 Sonic Güç Sistemi yükleniyor...")
print("⚡ Boost: Güç Biriktirme Sistemi Aktif")
wait(1)

-- SERVICES
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local Lighting = game:GetService("Lighting")
local Workspace = game:GetService("Workspace")

-- LOCAL PLAYER
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")
local camera = Workspace.CurrentCamera

-- AYARLAR
local Settings = {
    -- Hız ayarları
    NormalSpeed = 16,
    MinSonicSpeed = 200,  -- Minimum hız (0% şarj)
    MaxSonicSpeed = 800,  -- Maximum hız (100% şarj)
    SpeedDuration = 5,
    SpeedCooldown = 3,
    
    -- Güç biriktirme ayarları
    ChargeTime = 2.5,     -- Tam şarj olma süresi (saniye)
    ChargeRate = 1,       -- Şarj hızı
    
    -- Dash ayarları
    DashSpeed = 500,
    DashDuration = 0.8,
    DashCooldown = 2,
    
    -- Spin attack ayarları
    SpinDamage = 25,
    SpinRadius = 10,
    SpinCooldown = 3,
    
    -- Enerji ayarları
    MaxEnergy = 100,
    EnergyRegen = 5,
    SpeedEnergyCost = 20,  -- Arttırıldı (yüksek hız için)
    DashEnergyCost = 40,
    SpinEnergyCost = 25,
    
    -- Görsel efektler
    MotionBlurIntensity = 30, -- Arttırıldı
    MinFOV = 70,             -- Minimum FOV (100% şarj)
    MaxFOV = 100,            -- Maximum FOV (0% şarj)
    TrailDuration = 0.5,
    SpeedLines = true
}

-- DEĞİŞKENLER
local SonicData = {
    IsSonicSpeed = false,
    IsCharging = false,      -- YENİ: Güç biriktirme modu
    ChargePower = 0,         -- YENİ: Biriken güç (0-1)
    IsDashing = false,
    IsSpinning = false,
    Energy = Settings.MaxEnergy,
    SpeedCooldown = 0,
    DashCooldown = 0,
    SpinCooldown = 0,
    OriginalWalkSpeed = humanoid.WalkSpeed,
    OriginalFOV = camera.FieldOfView,
    Effects = {},
    Connections = {},
    LastBlurTween = nil,
    GUI = nil,
    ChargeUI = nil           -- YENİ: Şarj UI'sı
}

-- GÖRSEL EFEKT NESNELERİ
local motionBlur = nil
local speedLines = {}
local spinEffect = nil
local speedTrail = nil

-- GUI OLUŞTURMA (SENİN VERDİĞİN GİBİ)
function CreateGUI()
    local LMG2L = {}
    
    LMG2L["ScreenGui_1"] = Instance.new("ScreenGui", game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"))
    LMG2L["ScreenGui_1"]["ZIndexBehavior"] = Enum.ZIndexBehavior.Sibling
    
    -- DASH BUTONU (Kırmızı)
    LMG2L["TextButton_2"] = Instance.new("TextButton", LMG2L["ScreenGui_1"])
    LMG2L["TextButton_2"]["BorderSizePixel"] = 0
    LMG2L["TextButton_2"]["BackgroundColor3"] = Color3.fromRGB(255, 0, 0)
    LMG2L["TextButton_2"]["FontFace"] = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
    LMG2L["TextButton_2"]["BackgroundTransparency"] = 0.5
    LMG2L["TextButton_2"]["Size"] = UDim2.new(0, 40, 0, 32)
    LMG2L["TextButton_2"]["Text"] = "DASH"
    LMG2L["TextButton_2"]["Position"] = UDim2.new(0, 610, 0, 78)
    
    LMG2L["UICorner_3"] = Instance.new("UICorner", LMG2L["TextButton_2"])
    
    -- SPİN BUTONU (Mavi)
    LMG2L["TextButton_4"] = Instance.new("TextButton", LMG2L["TextButton_2"])
    LMG2L["TextButton_4"]["BorderSizePixel"] = 0
    LMG2L["TextButton_4"]["BackgroundColor3"] = Color3.fromRGB(0, 116, 255)
    LMG2L["TextButton_4"]["FontFace"] = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
    LMG2L["TextButton_4"]["BackgroundTransparency"] = 0.5
    LMG2L["TextButton_4"]["Size"] = UDim2.new(0, 40, 0, 32)
    LMG2L["TextButton_4"]["Text"] = "SPİN"
    LMG2L["TextButton_4"]["Position"] = UDim2.new(0, -38, 0, 36)
    
    LMG2L["UICorner_5"] = Instance.new("UICorner", LMG2L["TextButton_4"])
    
    -- BOOST BUTONU (Sarı)
    LMG2L["TextButton_6"] = Instance.new("TextButton", LMG2L["ScreenGui_1"])
    LMG2L["TextButton_6"]["BorderSizePixel"] = 0
    LMG2L["TextButton_6"]["BackgroundColor3"] = Color3.fromRGB(255, 193, 0)
    LMG2L["TextButton_6"]["Size"] = UDim2.new(0, 68, 0, 30)
    LMG2L["TextButton_6"]["Text"] = "BOOST"
    LMG2L["TextButton_6"]["Rotation"] = -45
    LMG2L["TextButton_6"]["Position"] = UDim2.new(0, 608, 0, 126)
    
    LMG2L["UICorner_7"] = Instance.new("UICorner", LMG2L["TextButton_6"])
    
    -- ENERJİ BAR KONTEYNERI
    LMG2L["ImageLabel_8"] = Instance.new("ImageLabel", LMG2L["ScreenGui_1"])
    LMG2L["ImageLabel_8"]["BorderSizePixel"] = 0
    LMG2L["ImageLabel_8"]["BackgroundColor3"] = Color3.fromRGB(0, 0, 0)
    LMG2L["ImageLabel_8"]["Size"] = UDim2.new(0, 190, 0, 40)
    LMG2L["ImageLabel_8"]["BackgroundTransparency"] = 0.3
    LMG2L["ImageLabel_8"]["Position"] = UDim2.new(0, 608, 0, -52)
    
    LMG2L["UICorner_9"] = Instance.new("UICorner", LMG2L["ImageLabel_8"])
    LMG2L["UICorner_9"]["CornerRadius"] = UDim.new(0, 6)
    
    LMG2L["UIStroke_a"] = Instance.new("UIStroke", LMG2L["ImageLabel_8"])
    LMG2L["UIStroke_a"]["Thickness"] = 0.5
    
    -- ENERJİ BAR
    LMG2L["ImageLabel_b"] = Instance.new("ImageLabel", LMG2L["ImageLabel_8"])
    LMG2L["ImageLabel_b"]["BorderSizePixel"] = 0
    LMG2L["ImageLabel_b"]["BackgroundColor3"] = Color3.fromRGB(0, 218, 255)
    LMG2L["ImageLabel_b"]["Size"] = UDim2.new(0, 154, 0, 10)
    LMG2L["ImageLabel_b"]["BackgroundTransparency"] = 0.1
    LMG2L["ImageLabel_b"]["Position"] = UDim2.new(0, 6, 0, 26)
    
    LMG2L["UICorner_c"] = Instance.new("UICorner", LMG2L["ImageLabel_b"])
    LMG2L["UICorner_c"]["CornerRadius"] = UDim.new(0, 4)
    
    LMG2L["UIStroke_d"] = Instance.new("UIStroke", LMG2L["ImageLabel_b"])
    
    -- ENERJİ YAZISI
    LMG2L["TextLabel_e"] = Instance.new("TextLabel", LMG2L["ImageLabel_8"])
    LMG2L["TextLabel_e"]["BorderSizePixel"] = 0
    LMG2L["TextLabel_e"]["TextSize"] = 18
    LMG2L["TextLabel_e"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255)
    LMG2L["TextLabel_e"]["FontFace"] = Font.new("rbxasset://fonts/families/ComicNeueAngular.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
    LMG2L["TextLabel_e"]["TextColor3"] = Color3.fromRGB(255, 255, 255)
    LMG2L["TextLabel_e"]["BackgroundTransparency"] = 1
    LMG2L["TextLabel_e"]["Size"] = UDim2.new(0, 24, 0, 10)
    LMG2L["TextLabel_e"]["Text"] = "ENERGY ~⚡⚡⚡~"
    LMG2L["TextLabel_e"]["Position"] = UDim2.new(0, 66, 0, 8)
    
    return {
        ScreenGui = LMG2L["ScreenGui_1"],
        BoostButton = LMG2L["TextButton_6"],
        DashButton = LMG2L["TextButton_2"],
        SpinButton = LMG2L["TextButton_4"],
        EnergyBar = LMG2L["ImageLabel_b"],
        EnergyText = LMG2L["TextLabel_e"],
        EnergyContainer = LMG2L["ImageLabel_8"]
    }
end

-- ŞARJ UI'SINI OLUŞTUR (KÜÇÜK ORTADA)
function CreateChargeUI()
    local chargeScreenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
    chargeScreenGui.Name = "SonicChargeUI"
    chargeScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
    chargeScreenGui.Enabled = false -- Başlangıçta gizli
    
    -- Ana container (KÜÇÜK ve ORTADA)
    local chargeContainer = Instance.new("Frame", chargeScreenGui)
    chargeContainer.Name = "ChargeContainer"
    chargeContainer.Size = UDim2.new(0, 120, 0, 20) -- KÜÇÜK
    chargeContainer.Position = UDim2.new(0.5, -60, 0.5, 150) -- ORTA ALT
    chargeContainer.BackgroundColor3 = Color3.fromRGB(20, 20, 30)
    chargeContainer.BackgroundTransparency = 0.7
    chargeContainer.BorderSizePixel = 0
    
    local containerCorner = Instance.new("UICorner", chargeContainer)
    containerCorner.CornerRadius = UDim.new(0, 5)
    
    local containerStroke = Instance.new("UIStroke", chargeContainer)
    containerStroke.Color = Color3.fromRGB(255, 193, 0)
    containerStroke.Thickness = 1
    
    -- Şarj bar arka plan
    local chargeBg = Instance.new("Frame", chargeContainer)
    chargeBg.Name = "ChargeBg"
    chargeBg.Size = UDim2.new(0.9, 0, 0.6, 0)
    chargeBg.Position = UDim2.new(0.05, 0, 0.2, 0)
    chargeBg.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
    chargeBg.BorderSizePixel = 0
    
    local bgCorner = Instance.new("UICorner", chargeBg)
    bgCorner.CornerRadius = UDim.new(0, 3)
    
    -- Şarj bar (dolacak olan)
    local chargeBar = Instance.new("Frame", chargeBg)
    chargeBar.Name = "ChargeBar"
    chargeBar.Size = UDim2.new(0, 0, 1, 0) -- Başlangıçta boş
    chargeBar.BackgroundColor3 = Color3.fromRGB(255, 193, 0) -- Boost rengi
    chargeBar.BorderSizePixel = 0
    
    local barCorner = Instance.new("UICorner", chargeBar)
    barCorner.CornerRadius = UDim.new(0, 3)
    
    -- Yüzde metni
    local percentText = Instance.new("TextLabel", chargeContainer)
    percentText.Name = "PercentText"
    percentText.Size = UDim2.new(1, 0, 0.3, 0)
    percentText.Position = UDim2.new(0, 0, 0.7, 0)
    percentText.BackgroundTransparency = 1
    percentText.Text = "CHARGE: 0%"
    percentText.TextColor3 = Color3.fromRGB(255, 193, 0)
    percentText.Font = Enum.Font.GothamBold
    percentText.TextSize = 12 -- KÜÇÜK
    percentText.TextStrokeTransparency = 0.5
    
    return {
        ScreenGui = chargeScreenGui,
        Container = chargeContainer,
        ChargeBar = chargeBar,
        PercentText = percentText,
        ChargeBg = chargeBg
    }
end

-- GUI'Yİ KURMA
function SetupGUI()
    -- Ana GUI'yi oluştur
    SonicData.GUI = CreateGUI()
    
    -- Şarj UI'sını oluştur
    SonicData.ChargeUI = CreateChargeUI()
    
    -- Buton etkileşimlerini ayarla
    SetupButtonInteractions()
    
    -- Enerji barını güncelle
    UpdateEnergyUI()
    
    print("✅ GUI ve Şarj UI'sı oluşturuldu")
    return true
end

-- BUTON ETKİLEŞİMLERİNİ AYARLA
function SetupButtonInteractions()
    if not SonicData.GUI then return end
    
    -- Boost Butonu (BASILI TUTMA MODU)
    local boostPressed = false
    local chargeStartTime = 0
    
    SonicData.GUI.BoostButton.MouseButton1Down:Connect(function()
        boostPressed = true
        chargeStartTime = os.clock()
        StartCharging()
    end)
    
    SonicData.GUI.BoostButton.MouseButton1Up:Connect(function()
        if boostPressed then
            boostPressed = false
            local chargeDuration = os.clock() - chargeStartTime
            ReleaseCharge(chargeDuration)
        end
    end)
    
    SonicData.GUI.BoostButton.MouseLeave:Connect(function()
        if boostPressed then
            boostPressed = false
            local chargeDuration = os.clock() - chargeStartTime
            ReleaseCharge(chargeDuration)
        end
    end)
    
    -- Dash Butonu
    SonicData.GUI.DashButton.MouseButton1Click:Connect(function()
        ActivateDash()
    end)
    
    -- Spin Butonu
    SonicData.GUI.SpinButton.MouseButton1Click:Connect(function()
        ActivateSpinAttack()
    end)
    
    print("🎮 Buton etkileşimleri ayarlandı (Boost: Basılı Tutma)")
end

-- ŞARJ BAŞLATMA
function StartCharging()
    if SonicData.IsDashing or SonicData.IsSpinning or SonicData.IsSonicSpeed then 
        print("⛔ Başka bir güç aktifken şarj yapılamaz!")
        return 
    end
    
    if os.clock() < SonicData.SpeedCooldown then
        local remaining = SonicData.SpeedCooldown - os.clock()
        print("⏳ Boost cooldown'da: " .. string.format("%.1f", remaining) .. "s")
        return
    end
    
    SonicData.IsCharging = true
    SonicData.ChargePower = 0
    
    -- Şarj UI'sını göster
    if SonicData.ChargeUI then
        SonicData.ChargeUI.ScreenGui.Enabled = true
        UpdateChargeUI()
    end
    
    -- FOV'u başlangıç değerine getir (zoom out)
    camera.FieldOfView = Settings.MaxFOV
    
    print("🔋 Şarj başladı...")
    
    -- Şarj artış loop'u
    local chargeLoop
    chargeLoop = RunService.Heartbeat:Connect(function(dt)
        if SonicData.IsCharging then
            -- Gücü biriktir
            SonicData.ChargePower = math.min(1, SonicData.ChargePower + (Settings.ChargeRate * dt / Settings.ChargeTime))
            
            -- FOV'u yavaşça azalt (zoom in)
            local targetFOV = Settings.MaxFOV - (SonicData.ChargePower * (Settings.MaxFOV - Settings.MinFOV))
            camera.FieldOfView = targetFOV
            
            -- UI'ı güncelle
            UpdateChargeUI()
            
            -- Tam şarj olduğunda bildir
            if SonicData.ChargePower >= 1 then
                print("⚡ TAM ŞARJ! Bırakabilirsin!")
            end
        else
            chargeLoop:Disconnect()
        end
    end)
    
    table.insert(SonicData.Connections, chargeLoop)
end

-- ŞARJ BIRAKMA (ANİ HIZLANMA)
function ReleaseCharge(chargeDuration)
    if not SonicData.IsCharging then return end
    
    SonicData.IsCharging = false
    
    -- Şarj UI'sını gizle
    if SonicData.ChargeUI then
        SonicData.ChargeUI.ScreenGui.Enabled = false
    end
    
    -- Enerji kontrolü
    local energyCost = Settings.SpeedEnergyCost * (0.5 + SonicData.ChargePower * 0.5)
    if not HasEnoughEnergy(energyCost) then
        print("🔋 Yetersiz enerji!")
        ForceClearBlur()
        return
    end
    
    -- Enerji tüket
    ConsumeEnergy(energyCost)
    
    -- Hızı hesapla (biriken güce göre)
    local speedMultiplier = SonicData.ChargePower
    local targetSpeed = Settings.MinSonicSpeed + (Settings.MaxSonicSpeed - Settings.MinSonicSpeed) * speedMultiplier
    
    print("🚀 Şarj bırakıldı!")
    print("   - Şarj Süresi: " .. string.format("%.2f", chargeDuration) .. "s")
    print("   - Şarj Gücü: " .. string.format("%.0f", SonicData.ChargePower * 100) .. "%")
    print("   - Hedef Hız: " .. math.floor(targetSpeed))
    print("   - Enerji Maliyeti: " .. math.floor(energyCost))
    
    -- ANİ HIZLANMA (yavaş yavaş değil, DİREKT!)
    SonicData.OriginalWalkSpeed = humanoid.WalkSpeed
    humanoid.WalkSpeed = targetSpeed -- DİREKT HEDEF HIZ!
    
    SonicData.IsSonicSpeed = true
    
    -- ANİ EFEKTLER
    ActivateSonicSpeedEffects(true, speedMultiplier)
    
    -- Cooldown başlat
    SonicData.SpeedCooldown = os.clock() + Settings.SpeedCooldown
    
    -- Buton durumlarını güncelle
    UpdateButtonStates()
    
    -- Sürekli enerji tüketimi
    local energyLoop
    energyLoop = RunService.Heartbeat:Connect(function(dt)
        if SonicData.IsSonicSpeed then
            if ConsumeEnergy(Settings.SpeedEnergyCost * dt * (0.5 + speedMultiplier)) <= 0 then
                -- Enerji bitti
                SonicData.IsSonicSpeed = false
                humanoid.WalkSpeed = SonicData.OriginalWalkSpeed
                ActivateSonicSpeedEffects(false)
                energyLoop:Disconnect()
            end
        else
            energyLoop:Disconnect()
        end
    end)
    table.insert(SonicData.Connections, energyLoop)
    
    -- Otomatik kapanma süresi
    task.spawn(function()
        local duration = Settings.SpeedDuration * (0.5 + speedMultiplier * 0.5)
        task.wait(duration)
        if SonicData.IsSonicSpeed then
            SonicData.IsSonicSpeed = false
            humanoid.WalkSpeed = SonicData.OriginalWalkSpeed
            ActivateSonicSpeedEffects(false)
        end
    end)
end

-- ŞARJ UI GÜNCELLEME
function UpdateChargeUI()
    if SonicData.ChargeUI and SonicData.ChargeUI.ChargeBar and SonicData.ChargeUI.PercentText then
        local chargePercent = SonicData.ChargePower * 100
        
        -- Bar boyutunu güncelle
        SonicData.ChargeUI.ChargeBar.Size = UDim2.new(SonicData.ChargePower, 0, 1, 0)
        
        -- Yüzde metnini güncelle
        SonicData.ChargeUI.PercentText.Text = "CHARGE: " .. math.floor(chargePercent) .. "%"
        
        -- Rengi şarj durumuna göre değiştir
        if chargePercent > 80 then
            SonicData.ChargeUI.ChargeBar.BackgroundColor3 = Color3.fromRGB(0, 255, 100) -- Yeşil (tam şarj)
            SonicData.ChargeUI.PercentText.TextColor3 = Color3.fromRGB(0, 255, 100)
        elseif chargePercent > 50 then
            SonicData.ChargeUI.ChargeBar.BackgroundColor3 = Color3.fromRGB(255, 193, 0) -- Sarı
            SonicData.ChargeUI.PercentText.TextColor3 = Color3.fromRGB(255, 193, 0)
        else
            SonicData.ChargeUI.ChargeBar.BackgroundColor3 = Color3.fromRGB(255, 100, 0) -- Turuncu
            SonicData.ChargeUI.PercentText.TextColor3 = Color3.fromRGB(255, 100, 0)
        end
    end
end

-- UI GÜNCELLEME
function UpdateEnergyUI()
    if SonicData.GUI and SonicData.GUI.EnergyBar and SonicData.GUI.EnergyText then
        local energyPercent = SonicData.Energy / Settings.MaxEnergy
        
        -- Enerji barını güncelle
        SonicData.GUI.EnergyBar.Size = UDim2.new(energyPercent, 0, 1, 0)
        
        -- Enerjiye göre renk değiştir
        if energyPercent > 0.6 then
            SonicData.GUI.EnergyBar.BackgroundColor3 = Color3.fromRGB(0, 218, 255)
        elseif energyPercent > 0.3 then
            SonicData.GUI.EnergyBar.BackgroundColor3 = Color3.fromRGB(255, 170, 0)
        else
            SonicData.GUI.EnergyBar.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
        end
        
        -- Buton durumlarını güncelle
        UpdateButtonStates()
    end
end

-- BUTON DURUMLARINI GÜNCELLE
function UpdateButtonStates()
    if not SonicData.GUI then return end
    
    local buttons = {
        {button = SonicData.GUI.BoostButton, cooldown = SonicData.SpeedCooldown, cost = Settings.SpeedEnergyCost, name = "BOOST"},
        {button = SonicData.GUI.DashButton, cooldown = SonicData.DashCooldown, cost = Settings.DashEnergyCost, name = "DASH"},
        {button = SonicData.GUI.SpinButton, cooldown = SonicData.SpinCooldown, cost = Settings.SpinEnergyCost, name = "SPİN"}
    }
    
    for _, btnData in pairs(buttons) do
        if btnData.button then
            local remaining = btnData.cooldown - os.clock()
            local hasEnergy = SonicData.Energy >= btnData.cost
            
            if remaining > 0 then
                btnData.button.Text = string.format("%.1f", remaining) .. "s"
                btnData.button.BackgroundTransparency = 0.7
            elseif not hasEnergy then
                btnData.button.Text = "NO NRJ"
                btnData.button.BackgroundTransparency = 0.7
            else
                btnData.button.Text = btnData.name
                btnData.button.BackgroundTransparency = 0.5
                
                if btnData.button == SonicData.GUI.BoostButton then
                    btnData.button.BackgroundColor3 = Color3.fromRGB(255, 193, 0)
                elseif btnData.button == SonicData.GUI.DashButton then
                    btnData.button.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
                else
                    btnData.button.BackgroundColor3 = Color3.fromRGB(0, 116, 255)
                end
            end
        end
    end
end

-- EFEKT KONTROL FONKSİYONLARI
function ActivateSonicSpeedEffects(active, speedMultiplier)
    speedMultiplier = speedMultiplier or 1
    
    if active then
        -- ANİ FOV artışı (şarj gücüne göre)
        local fovIncrease = 20 + (20 * speedMultiplier)
        camera.FieldOfView = SonicData.OriginalFOV + fovIncrease
        
        -- ANİ MOTION BLUR (şarj gücüne göre)
        if not motionBlur then
            motionBlur = Instance.new("BlurEffect")
            motionBlur.Name = "SonicMotionBlur"
            motionBlur.Size = 0
            motionBlur.Parent = Lighting
        end
        motionBlur.Enabled = true
        motionBlur.Size = Settings.MotionBlurIntensity * speedMultiplier
        
        -- Speed trail
        if not speedTrail then
            speedTrail = Instance.new("Trail")
            speedTrail.Color = ColorSequence.new({
                ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 170, 255)),
                ColorSequenceKeypoint.new(0.5, Color3.fromRGB(100, 255, 255)),
                ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 100, 255))
            })
            speedTrail.Transparency = NumberSequence.new({
                NumberSequenceKeypoint.new(0, 0.2),
                NumberSequenceKeypoint.new(0.5, 0.5),
                NumberSequenceKeypoint.new(1, 1)
            })
            speedTrail.Lifetime = Settings.TrailDuration * (0.5 + speedMultiplier * 0.5)
            speedTrail.WidthScale = NumberSequence.new(1 + speedMultiplier * 2)
            
            local attachment0 = Instance.new("Attachment")
            attachment0.Position = Vector3.new(1, 0.5, 0)
            attachment0.Parent = rootPart
            
            local attachment1 = Instance.new("Attachment")
            attachment1.Position = Vector3.new(-1, 0.5, 0)
            attachment1.Parent = rootPart
            
            speedTrail.Attachment0 = attachment0
            speedTrail.Attachment1 = attachment1
            speedTrail.Parent = rootPart
        end
        speedTrail.Enabled = true
        
        -- Speed lines
        if Settings.SpeedLines then
            for _, line in pairs(speedLines) do
                line.Emitter.Enabled = true
                line.Emitter.Rate = 50 + (50 * speedMultiplier)
            end
        end
        
        -- ANİ EKRAN TİTREMESİ (şarj gücüne göre)
        local shakeConnection
        shakeConnection = RunService.RenderStepped:Connect(function()
            if not SonicData.IsSonicSpeed then
                if shakeConnection then
                    shakeConnection:Disconnect()
                end
                return
            end
            
            local shakeIntensity = 0.1 * speedMultiplier
            local shake = Vector3.new(
                (math.random() * 2 - 1) * shakeIntensity,
                (math.random() * 2 - 1) * shakeIntensity,
                0
            )
            camera.CFrame = camera.CFrame * CFrame.new(shake)
        end)
        table.insert(SonicData.Connections, shakeConnection)
        
    else
        -- FOV normale dön
        camera.FieldOfView = SonicData.OriginalFOV
        
        -- Blur'u kapat
        if motionBlur then
            motionBlur.Enabled = false
            motionBlur.Size = 0
        end
        
        -- Speed trail kapat
        if speedTrail then
            speedTrail.Enabled = false
        end
        
        -- Speed lines kapat
        for _, line in pairs(speedLines) do
            line.Emitter.Enabled = false
        end
    end
end

function ActivateDashEffects()
    print("💨 Dash!")
    
    -- ANİ FOV artışı
    camera.FieldOfView = SonicData.OriginalFOV + 40
    
    task.delay(Settings.DashDuration, function()
        camera.FieldOfView = SonicData.OriginalFOV
    end)
    
    -- Dash trail efekti
    local dashTrail = Instance.new("Trail")
    dashTrail.Color = ColorSequence.new(Color3.fromRGB(0, 255, 255))
    dashTrail.Transparency = NumberSequence.new(0.3)
    dashTrail.Lifetime = 0.4
    dashTrail.WidthScale = NumberSequence.new(3)
    
    local att0 = Instance.new("Attachment")
    att0.Position = Vector3.new(0, 2, 0)
    att0.Parent = rootPart
    
    local att1 = Instance.new("Attachment")
    att1.Position = Vector3.new(0, 2, -2)
    att1.Parent = rootPart
    
    dashTrail.Attachment0 = att0
    dashTrail.Attachment1 = att1
    dashTrail.Parent = rootPart
    
    Debris:AddItem(dashTrail, 1)
end

function ActivateSpinEffects()
    print("🌀 Spin Attack!")
    
    -- Spin efekti
    if not spinEffect then
        spinEffect = {
            Part = Instance.new("Part"),
            Emitter = Instance.new("ParticleEmitter")
        }
        spinEffect.Part.Transparency = 1
        spinEffect.Part.Anchored = true
        spinEffect.Part.CanCollide = false
        spinEffect.Part.Size = Vector3.new(1, 1, 1)
        spinEffect.Part.Parent = Workspace.Terrain
        
        local attachment = Instance.new("Attachment")
        attachment.Parent = spinEffect.Part
        
        spinEffect.Emitter.Texture = "rbxassetid://242842722"
        spinEffect.Emitter.Color = ColorSequence.new(Color3.fromRGB(0, 170, 255))
        spinEffect.Emitter.Transparency = NumberSequence.new({
            NumberSequenceKeypoint.new(0, 0),
            NumberSequenceKeypoint.new(0.8, 0.3),
            NumberSequenceKeypoint.new(1, 1)
        })
        spinEffect.Emitter.Size = NumberSequence.new({
            NumberSequenceKeypoint.new(0, 3),
            NumberSequenceKeypoint.new(1, 0)
        })
        spinEffect.Emitter.Lifetime = NumberRange.new(0.5)
        spinEffect.Emitter.Rate = 400
        spinEffect.Emitter.Speed = NumberRange.new(20)
        spinEffect.Emitter.Rotation = NumberRange.new(0, 360)
        spinEffect.Emitter.Parent = attachment
    end
    spinEffect.Emitter.Enabled = true
    
    -- 1 saniye sonra efekti kapat
    task.delay(1, function()
        if spinEffect then
            spinEffect.Emitter.Enabled = false
        end
    end)
end

-- DASH FONKSİYONU
function ActivateDash()
    if SonicData.IsDashing or SonicData.IsSpinning or SonicData.IsCharging or SonicData.IsSonicSpeed then 
        print("⛔ Başka bir güç aktif!")
        return 
    end
    
    if os.clock() < SonicData.DashCooldown then
        local remaining = SonicData.DashCooldown - os.clock()
        print("⏳ Dash cooldown'da: " .. string.format("%.1f", remaining) .. "s")
        return
    end
    
    if not HasEnoughEnergy(Settings.DashEnergyCost) then
        print("🔋 Yetersiz enerji!")
        return
    end
    
    SonicData.IsDashing = true
    ConsumeEnergy(Settings.DashEnergyCost)
    
    -- Dash yönü
    local lookVector = camera.CFrame.LookVector
    lookVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
    
    -- GÜÇLÜ Dash kuvveti
    local dashVelocity = Instance.new("BodyVelocity")
    dashVelocity.Velocity = lookVector * Settings.DashSpeed
    dashVelocity.MaxForce = Vector3.new(20000, 0, 20000)
    dashVelocity.P = 20000
    dashVelocity.Parent = rootPart
    
    ActivateDashEffects()
    
    task.delay(Settings.DashDuration, function()
        if dashVelocity and dashVelocity.Parent then
            dashVelocity:Destroy()
        end
        SonicData.IsDashing = false
        SonicData.DashCooldown = os.clock() + Settings.DashCooldown
        UpdateButtonStates()
    end)
end

-- SPIN FONKSİYONU
function ActivateSpinAttack()
    if SonicData.IsDashing or SonicData.IsSpinning or SonicData.IsCharging or SonicData.IsSonicSpeed then 
        print("⛔ Başka bir güç aktif!")
        return 
    end
    
    if os.clock() < SonicData.SpinCooldown then
        local remaining = SonicData.SpinCooldown - os.clock()
        print("⏳ Spin cooldown'da: " .. string.format("%.1f", remaining) .. "s")
        return
    end
    
    if not HasEnoughEnergy(Settings.SpinEnergyCost) then
        print("🔋 Yetersiz enerji!")
        return
    end
    
    SonicData.IsSpinning = true
    ConsumeEnergy(Settings.SpinEnergyCost)
    
    ActivateSpinEffects()
    
    task.delay(1, function()
        SonicData.IsSpinning = false
        SonicData.SpinCooldown = os.clock() + Settings.SpinCooldown
        UpdateButtonStates()
    end)
end

-- YARDIMCI FONKSİYONLAR
function HasEnoughEnergy(cost)
    return SonicData.Energy >= cost
end

function ConsumeEnergy(amount)
    SonicData.Energy = math.max(0, SonicData.Energy - amount)
    UpdateEnergyUI()
    return SonicData.Energy
end

function RegenerateEnergy(dt)
    if not SonicData.IsSonicSpeed and not SonicData.IsDashing and not SonicData.IsSpinning and not SonicData.IsCharging then
        SonicData.Energy = math.min(Settings.MaxEnergy, SonicData.Energy + Settings.EnergyRegen * dt)
        UpdateEnergyUI()
    end
end

function ForceClearBlur()
    if motionBlur then
        motionBlur.Enabled = false
        motionBlur.Size = 0
    end
    camera.FieldOfView = SonicData.OriginalFOV
end

-- ANA BAŞLATMA
function InitializeSonicPowers()
    print("🚀 Sonic Güçleri başlatılıyor...")
    
    if not character or not humanoid or not rootPart then
        warn("❌ Karakter bileşenleri bulunamadı!")
        return false
    end
    
    if not SetupGUI() then
        warn("❌ GUI kurulumu başarısız!")
        return false
    end
    
    -- Enerji regen loop'u
    local regenLoop = RunService.Heartbeat:Connect(function(dt)
        RegenerateEnergy(dt)
        UpdateButtonStates()
    end)
    table.insert(SonicData.Connections, regenLoop)
    
    -- Ölüm kontrolü
    local deathConnection = humanoid.Died:Connect(function()
        print("💀 Karakter öldü, güçler sıfırlanıyor...")
        CleanupEffects()
    end)
    table.insert(SonicData.Connections, deathConnection)
    
    print("✅ Sonic Güçleri başarıyla yüklendi!")
    print("=====================================")
    print("🎮 YENİ BOOST SİSTEMİ:")
    print("   - Basılı tut: Güç birikir")
    print("   - Bırak: ANİ hızlanma!")
    print("   - Ne kadar uzun tutarsan o kadar hızlı!")
    print("=====================================")
    
    return true
end

-- TEMİZLİK
function CleanupEffects()
    ForceClearBlur()
    
    for _, connection in pairs(SonicData.Connections) do
        if connection and typeof(connection) == "RBXScriptConnection" then
            pcall(function() connection:Disconnect() end)
        end
    end
    SonicData.Connections = {}
    
    if SonicData.GUI and SonicData.GUI.ScreenGui then
        SonicData.GUI.ScreenGui:Destroy()
    end
    if SonicData.ChargeUI and SonicData.ChargeUI.ScreenGui then
        SonicData.ChargeUI.ScreenGui:Destroy()
    end
    
    if humanoid then
        humanoid.WalkSpeed = SonicData.OriginalWalkSpeed
    end
end

-- ÇALIŞTIRMA
local success, errorMsg = pcall(function()
    InitializeSonicPowers()
end)

if not success then
    warn("❌ Hata: " .. errorMsg)
    pcall(function()
        CleanupEffects()
        InitializeSonicPowers()
    end)
end

-- EXECUTOR KOMUTLARI
_G.DisableSonicPowers = function()
    print("🔴 Sonic Güçleri kapatılıyor...")
    CleanupEffects()
    print("✨ Güçler kapatıldı!")
end

_G.RefillEnergy = function()
    SonicData.Energy = Settings.MaxEnergy
    UpdateEnergyUI()
    print("🔋 Enerji doldu!")
end

print("\n💡 Executor Komutları:")
print("  - _G.DisableSonicPowers() : Kapat")
print("  - _G.RefillEnergy() : Enerji Doldur")
print("\n🎮 İyi oyunlar! Boost'u dene, harika olacak! ⚡")

return {
    Disable = _G.DisableSonicPowers,
    RefillEnergy = _G.RefillEnergy
}

Features & Information

Only speed,.. Fr

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts