Shader
Key RequiredUniversal

Shader

Universal Scriptakkiiakkii 2.4K views 2K executesUpdated Dec 23, 2025
5.0/ 5(2 votes)
20100% Positive
Lua Script•463 lines (14053 chars)
-- AK.GUI - シェーダーエフェクトGUI(白黒機能追加版)
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local SoundService = game:GetService("SoundService")
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

-- 音声アセットID
local START_SOUND_ID = "1837769261"      -- スクリプト読み込み時の音声
local BUTTON_SOUND_ID = "115916891254154"  -- ボタン操作時の音声

-- 音声再生関数
local function playSound(soundId)
    local sound = Instance.new("Sound")
    sound.SoundId = "rbxassetid://" .. soundId
    sound.Parent = SoundService
    sound:Play()
    
    sound.Ended:Connect(function()
        sound:Destroy()
    end)
end

-- スクリプト読み込み時の音声再生
playSound(START_SOUND_ID)

-- 現在の照明設定を保存(リセット用)
local originalLighting = {
    ClockTime = Lighting.ClockTime,
    Brightness = Lighting.Brightness,
    Ambient = Lighting.Ambient,
    OutdoorAmbient = Lighting.OutdoorAmbient,
    ColorShift_Top = Lighting.ColorShift_Top,
    ColorShift_Bottom = Lighting.ColorShift_Bottom,
    FogColor = Lighting.FogColor,
    FogStart = Lighting.FogStart,
    FogEnd = Lighting.FogEnd,
    GlobalShadows = Lighting.GlobalShadows,
    ShadowSoftness = Lighting.ShadowSoftness,
    Technology = Lighting.Technology,
    EnvironmentDiffuseScale = Lighting.EnvironmentDiffuseScale,
    EnvironmentSpecularScale = Lighting.EnvironmentSpecularScale
}

-- GUI作成
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "AK_SHADER_GUI"
screenGui.ResetOnSpawn = false
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screenGui.Parent = playerGui

-- メインフレーム
local mainFrame = Instance.new("Frame")
mainFrame.Name = "MainFrame"
mainFrame.Size = UDim2.new(0, 180, 0, 210)  -- 高さを増やして⑤ボタン用のスペースを確保
mainFrame.Position = UDim2.new(0, 10, 0, 10)
mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
mainFrame.BorderSizePixel = 0
mainFrame.BackgroundTransparency = 0.05
mainFrame.Parent = screenGui

-- 角丸
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 10)
corner.Parent = mainFrame

-- ボーダー
local border = Instance.new("UIStroke")
border.Color = Color3.fromRGB(80, 80, 120)
border.Thickness = 2
border.Parent = mainFrame

-- タイトル
local title = Instance.new("TextLabel")
title.Name = "Title"
title.Size = UDim2.new(1, 0, 0, 25)
title.Position = UDim2.new(0, 0, 0, 0)
title.BackgroundColor3 = Color3.fromRGB(40, 40, 60)
title.TextColor3 = Color3.fromRGB(220, 220, 255)
title.Text = "🌇シェーダー🌇"
title.Font = Enum.Font.GothamBold
title.TextSize = 14
title.Parent = mainFrame

local titleCorner = Instance.new("UICorner")
titleCorner.CornerRadius = UDim.new(0, 10)
titleCorner.Parent = title

-- コントロールボタンコンテナ
local controlContainer = Instance.new("Frame")
controlContainer.Name = "ControlContainer"
controlContainer.Size = UDim2.new(1, -20, 0, 20)
controlContainer.Position = UDim2.new(0, 10, 1, -25)
controlContainer.BackgroundTransparency = 1
controlContainer.Parent = mainFrame

-- コントロールボタンのレイアウト
local controlLayout = Instance.new("UIGridLayout")
controlLayout.CellSize = UDim2.new(0.5, -4, 1, 0)
controlLayout.CellPadding = UDim2.new(0, 8, 0, 0)
controlLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
controlLayout.Parent = controlContainer

-- Hideボタン
local toggleButton = Instance.new("TextButton")
toggleButton.Name = "ToggleButton"
toggleButton.Size = UDim2.new(1, 0, 1, 0)
toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 80)
toggleButton.TextColor3 = Color3.fromRGB(200, 200, 255)
toggleButton.Text = "Hide"
toggleButton.Font = Enum.Font.Gotham
toggleButton.TextSize = 10
toggleButton.Parent = controlContainer

local toggleCorner = Instance.new("UICorner")
toggleCorner.CornerRadius = UDim.new(0, 6)
toggleCorner.Parent = toggleButton

-- Pinボタン
local pinButton = Instance.new("TextButton")
pinButton.Name = "PinButton"
pinButton.Size = UDim2.new(1, 0, 1, 0)
pinButton.BackgroundColor3 = Color3.fromRGB(160, 100, 220)
pinButton.TextColor3 = Color3.fromRGB(255, 255, 255)
pinButton.Text = "Fixed GUI"
pinButton.Font = Enum.Font.Gotham
pinButton.TextSize = 10
pinButton.Parent = controlContainer

local pinCorner = Instance.new("UICorner")
pinCorner.CornerRadius = UDim.new(0, 6)
pinCorner.Parent = pinButton

-- ボタンコンテナ
local buttonContainer = Instance.new("Frame")
buttonContainer.Name = "ButtonContainer"
buttonContainer.Size = UDim2.new(1, -20, 1, -60)
buttonContainer.Position = UDim2.new(0, 10, 0, 30)
buttonContainer.BackgroundTransparency = 1
buttonContainer.Visible = true
buttonContainer.Parent = mainFrame

-- ボタンレイアウト
local layout = Instance.new("UIListLayout")
layout.Padding = UDim.new(0, 6)
layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
layout.VerticalAlignment = Enum.VerticalAlignment.Top
layout.Parent = buttonContainer

-- ボタン作成関数
function createButton(text, color)
    local button = Instance.new("TextButton")
    button.Name = text .. "Button"
    button.Size = UDim2.new(1, 0, 0, 28)
    button.BackgroundColor3 = color
    button.TextColor3 = Color3.fromRGB(255, 255, 255)
    button.Text = text
    button.Font = Enum.Font.Gotham
    button.TextSize = 12
    button.AutoButtonColor = true
    
    local buttonCorner = Instance.new("UICorner")
    buttonCorner.CornerRadius = UDim.new(0, 6)
    buttonCorner.Parent = button
    
    return button
end

-- ① 夜の雰囲気ボタン
local nightButton = createButton("① 夜", Color3.fromRGB(0, 120, 255))
nightButton.Parent = buttonContainer

-- ② 夕方の雰囲気ボタン
local sunsetButton = createButton("② 夕方", Color3.fromRGB(255, 100, 150))
sunsetButton.Parent = buttonContainer

-- ③ 暗視ボタン
local nightVisionButton = createButton("③ 暗視", Color3.fromRGB(0, 180, 60))
nightVisionButton.Parent = buttonContainer

-- ④ 白黒ボタン
local monochromeButton = createButton("④ 白黒", Color3.fromRGB(128, 128, 128))  -- グレー色
monochromeButton.Parent = buttonContainer

-- ⑤ リセットボタン
local resetButton = createButton("⑤ Reset", Color3.fromRGB(220, 60, 60))
resetButton.Parent = buttonContainer

-- ステータス表示
local statusLabel = Instance.new("TextLabel")
statusLabel.Name = "StatusLabel"
statusLabel.Size = UDim2.new(1, -10, 0, 15)
statusLabel.Position = UDim2.new(0, 5, 1, -50)
statusLabel.BackgroundTransparency = 1
statusLabel.TextColor3 = Color3.fromRGB(180, 180, 220)
statusLabel.Text = "Ready - Unpinned"
statusLabel.Font = Enum.Font.Gotham
statusLabel.TextSize = 10
statusLabel.TextXAlignment = Enum.TextXAlignment.Left
statusLabel.Parent = mainFrame

-- GUI固定状態の変数
local isGUIPinned = false

-- GUI固定/解除関数
local function toggleGUIPin()
    isGUIPinned = not isGUIPinned
    
    if isGUIPinned then
        pinButton.Text = "Unpin GUI"
        pinButton.BackgroundColor3 = Color3.fromRGB(120, 80, 180)
        statusLabel.Text = "GUI Fixed"
        statusLabel.TextColor3 = Color3.fromRGB(180, 140, 255)
    else
        pinButton.Text = "Fixed GUI"
        pinButton.BackgroundColor3 = Color3.fromRGB(160, 100, 220)
        statusLabel.Text = "GUI Unpinned"
        statusLabel.TextColor3 = Color3.fromRGB(180, 180, 220)
    end
    
    return true, isGUIPinned and "✅ GUI Fixed" or "✅ GUI Unpinned"
end

-- シェーダー機能関数
local function applyNightShader()
    -- 夜の雰囲気
    Lighting.ClockTime = 0  -- 深夜
    Lighting.Brightness = 0.1
    Lighting.Ambient = Color3.fromRGB(30, 30, 60)
    Lighting.OutdoorAmbient = Color3.fromRGB(30, 30, 60)
    Lighting.ColorShift_Top = Color3.fromRGB(0, 0, 50)
    Lighting.ColorShift_Bottom = Color3.fromRGB(0, 0, 30)
    Lighting.FogColor = Color3.fromRGB(10, 10, 40)
    Lighting.FogStart = 100
    Lighting.FogEnd = 500
    Lighting.GlobalShadows = true
    Lighting.ShadowSoftness = 0.5
    statusLabel.Text = "✅ 夜の雰囲気を適用"
    statusLabel.TextColor3 = Color3.fromRGB(100, 150, 255)
end

local function applySunsetShader()
    -- 改良版:夕焼け風の夕方の雰囲気
    Lighting.ClockTime = 18.5  -- 夕方6時半(黄金時刻)
    Lighting.Brightness = 0.25  -- 少し暗めにして夕方感を出す
    
    -- より夕焼け風のカラースキーム
    Lighting.Ambient = Color3.fromRGB(255, 120, 160)  -- ピンクっぽいアンビエント
    Lighting.OutdoorAmbient = Color3.fromRGB(255, 140, 180)  -- 明るいピンク
    
    -- カラーシフトでグラデーションを作成
    Lighting.ColorShift_Top = Color3.fromRGB(255, 80, 120)    -- 上部:濃いピンク
    Lighting.ColorShift_Bottom = Color3.fromRGB(255, 180, 100) -- 下部:黄金色
    
    -- 霧の色も夕焼け風に
    Lighting.FogColor = Color3.fromRGB(255, 150, 100)  -- オレンジピンクの霧
    Lighting.FogStart = 30  -- 近くから霧を開始
    Lighting.FogEnd = 250   -- 適度な距離で霧を終了
    
    -- 影の設定を強化(夕方は影が長くなる)
    Lighting.GlobalShadows = true
    Lighting.ShadowSoftness = 0.7  -- 柔らかい影
    
    statusLabel.Text = "✅ 夕焼け風の夕方を適用"
    statusLabel.TextColor3 = Color3.fromRGB(255, 120, 180)  -- ピンク色のテキスト
end

local function applyNightVision()
    -- 暗視効果
    Lighting.Brightness = 5  -- 明るさを大幅に上げる
    Lighting.Ambient = Color3.fromRGB(0, 255, 0)  -- 緑色の暗視効果
    Lighting.OutdoorAmbient = Color3.fromRGB(0, 200, 0)
    Lighting.ColorShift_Top = Color3.fromRGB(0, 100, 0)
    Lighting.ColorShift_Bottom = Color3.fromRGB(0, 150, 0)
    Lighting.FogColor = Color3.fromRGB(0, 50, 0)
    Lighting.FogStart = 500
    Lighting.FogEnd = 1000
    Lighting.GlobalShadows = false  -- 暗視時は影を無効化
    statusLabel.Text = "✅ 暗視効果を適用"
    statusLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
end

-- 白黒効果用の変数
local monochromeEffectActive = false
local originalColorCorrection = nil
local currentColorCorrection = nil

local function applyMonochromeShader()
    -- 白黒効果を適用
    if currentColorCorrection then
        currentColorCorrection:Destroy()
    end
    
    -- ColorCorrectionエフェクトを作成
    currentColorCorrection = Instance.new("ColorCorrectionEffect")
    currentColorCorrection.Name = "MonochromeEffect"
    currentColorCorrection.Parent = Lighting
    
    -- 白黒効果の設定
    currentColorCorrection.Brightness = 0.05  -- 少し明るく
    currentColorCorrection.Contrast = 0.1     -- 少しコントラストを上げる
    currentColorCorrection.Saturation = -1    -- 彩度を完全に下げて白黒に
    currentColorCorrection.TintColor = Color3.fromRGB(255, 255, 255)  -- ニュートラルな色
    
    -- 照明もモノクローム風に調整
    Lighting.Ambient = Color3.fromRGB(128, 128, 128)  -- グレーのアンビエント
    Lighting.OutdoorAmbient = Color3.fromRGB(150, 150, 150)
    Lighting.ColorShift_Top = Color3.fromRGB(128, 128, 128)
    Lighting.ColorShift_Bottom = Color3.fromRGB(128, 128, 128)
    
    -- 明るさ調整
    Lighting.Brightness = 0.8
    Lighting.FogColor = Color3.fromRGB(100, 100, 100)  -- グレーの霧
    
    monochromeEffectActive = true
    statusLabel.Text = "✅ 白黒効果を適用"
    statusLabel.TextColor3 = Color3.fromRGB(200, 200, 200)  -- グレーのテキスト
end

local function resetLighting()
    -- 元の照明設定に戻す
    for property, value in pairs(originalLighting) do
        Lighting[property] = value
    end
    
    -- 白黒効果を削除
    if currentColorCorrection then
        currentColorCorrection:Destroy()
        currentColorCorrection = nil
    end
    
    monochromeEffectActive = false
    statusLabel.Text = "✅ 照明をリセット"
    statusLabel.TextColor3 = Color3.fromRGB(180, 180, 220)
end

-- ボタン機能接続(音声再生付き)
nightButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    if monochromeEffectActive then
        resetLighting()
    end
    applyNightShader()
end)

sunsetButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    if monochromeEffectActive then
        resetLighting()
    end
    applySunsetShader()
end)

nightVisionButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    if monochromeEffectActive then
        resetLighting()
    end
    applyNightVision()
end)

monochromeButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    applyMonochromeShader()
end)

resetButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    resetLighting()
end)

-- GUI固定ボタン(音声再生付き)
pinButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    local success, message = toggleGUIPin()
    statusLabel.Text = message
    statusLabel.TextColor3 = Color3.fromRGB(180, 140, 255)
end)

-- トグル機能(音声再生付き)
toggleButton.MouseButton1Click:Connect(function()
    playSound(BUTTON_SOUND_ID)
    if buttonContainer.Visible then
        buttonContainer.Visible = false
        mainFrame.Size = UDim2.new(0, 180, 0, 50)
        toggleButton.Text = "Show"
        statusLabel.Text = "GUI Hidden"
    else
        buttonContainer.Visible = true
        mainFrame.Size = UDim2.new(0, 180, 0, 210)  -- 高さを⑤ボタン用に調整
        toggleButton.Text = "Hide"
        statusLabel.Text = isGUIPinned and "GUI Fixed" or "GUI Unpinned"
    end
end)

-- ドラッグ機能(マウスとタッチ対応)
local dragging = false
local dragStart, startPos

local function handleDragStart(input)
    if not isGUIPinned then
        dragging = true
        dragStart = input.Position
        startPos = mainFrame.Position
        
        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then
                dragging = false
            end
        end)
    end
end

local function handleDrag(input)
    if dragging and not isGUIPinned then
        local delta = input.Position - dragStart
        mainFrame.Position = UDim2.new(
            startPos.X.Scale, 
            startPos.X.Offset + delta.X, 
            startPos.Y.Scale, 
            startPos.Y.Offset + delta.Y
        )
    end
end

-- マウス入力
title.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        handleDragStart(input)
    end
end)

title.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        handleDrag(input)
    end
end)

-- タッチ入力
title.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Touch then
        handleDragStart(input)
    end
end)

title.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Touch then
        handleDrag(input)
    end
end)

-- ゲーム終了時に元の設定に戻す
game:GetService("Players").PlayerRemoving:Connect(function(leavingPlayer)
    if leavingPlayer == player then
        resetLighting()
    end
end)

-- 初期ステータス表示
statusLabel.Text = "Ready - シェーダーを選択してください"

Features & Information

​"This shader script features dynamic lighting and shadow enhancement, with a built-in night mode toggle."

Community Comments (1)

De*666De*666Jul 22, 2026

使ってみたよ 普通にシェーダーでしたね!綺麗でしたので 次のアッキーさんのシェーダースクリプトを使います

More Scripts for Universal Scripts