VR controller open source
Key RequiredUniversal

VR controller open source

Universal ScriptZezorgotbannedZezorgotbanned 5.8K views 270 executesUpdated Oct 30, 2025
1.7/ 5(6 votes)
2433% Positive
Lua Script•470 lines (14733 chars)
-- VR Controller GUI
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local SoundService = game:GetService("SoundService")

-- Создаем основной GUI
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "VRController"
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = PlayerGui

-- Основной фрейм
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 200, 0, 160)
MainFrame.Position = UDim2.new(0, 10, 0, 10)
MainFrame.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
MainFrame.BorderSizePixel = 2
MainFrame.BorderColor3 = Color3.new(1, 1, 1)
MainFrame.Active = true
MainFrame.Draggable = true
MainFrame.Parent = ScreenGui

-- Заголовок
local Title = Instance.new("TextLabel")
Title.Name = "Title"
Title.Size = UDim2.new(1, 0, 0, 30)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
Title.TextColor3 = Color3.new(1, 1, 1)
Title.Text = "VR Controller"
Title.Font = Enum.Font.GothamBold
Title.TextSize = 16
Title.Parent = MainFrame

-- Кнопка START VR / STOP VR
local VRButton = Instance.new("TextButton")
VRButton.Name = "VRButton"
VRButton.Size = UDim2.new(0.8, 0, 0, 30)
VRButton.Position = UDim2.new(0.1, 0, 0.2, 0)
VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
VRButton.TextColor3 = Color3.new(1, 1, 1)
VRButton.Text = "START VR"
VRButton.Font = Enum.Font.Gotham
VRButton.TextSize = 14
VRButton.Parent = MainFrame

-- Кнопка GAMEPASSES
local GamepassesButton = Instance.new("TextButton")
GamepassesButton.Name = "GamepassesButton"
GamepassesButton.Size = UDim2.new(0.8, 0, 0, 30)
GamepassesButton.Position = UDim2.new(0.1, 0, 0.45, 0)
GamepassesButton.BackgroundColor3 = Color3.new(0, 0.3, 0.8)
GamepassesButton.TextColor3 = Color3.new(1, 1, 1)
GamepassesButton.Text = "GAMEPASSES"
GamepassesButton.Font = Enum.Font.Gotham
GamepassesButton.TextSize = 14
GamepassesButton.Parent = MainFrame

-- Кнопка SHOW RIG / HIDE RIG
local RigButton = Instance.new("TextButton")
RigButton.Name = "RigButton"
RigButton.Size = UDim2.new(0.8, 0, 0, 30)
RigButton.Position = UDim2.new(0.1, 0, 0.7, 0)
RigButton.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5)
RigButton.TextColor3 = Color3.new(1, 1, 1)
RigButton.Text = "SHOW RIG"
RigButton.Font = Enum.Font.Gotham
RigButton.TextSize = 14
RigButton.Parent = MainFrame

-- Переменные для управления VR скриптом
local VRScriptActive = false
local VRScreenGui = nil
local VRConnection = nil
local RigVisible = false
local LeftRigPart = nil
local RightRigPart = nil
local RigConnection = nil

-- Функция проверки R6/R15
local function isR6()
    local character = LocalPlayer.Character
    if character and character:FindFirstChild("Humanoid") then
        return character.Humanoid.RigType == Enum.HumanoidRigType.R6
    end
    return false
end

-- Функция для безопасного получения персонажа
local function getCharacter()
    local character = LocalPlayer.Character
    if character and character:FindFirstChild("Humanoid") and character.Humanoid.Health > 0 then
        return character
    end
    return nil
end

-- Функция показа сообщения BY WFSBRO и музыки
local function showIntro()
    -- Создаем GUI для текста
    local IntroGui = Instance.new("ScreenGui")
    IntroGui.Name = "IntroGUI"
    IntroGui.ResetOnSpawn = false
    IntroGui.Parent = PlayerGui
    
    local IntroFrame = Instance.new("Frame")
    IntroFrame.Size = UDim2.new(0, 300, 0, 100)
    IntroFrame.Position = UDim2.new(0.5, -150, 0.5, -50)
    IntroFrame.BackgroundColor3 = Color3.new(0, 0, 0)
    IntroFrame.BackgroundTransparency = 0.3
    IntroFrame.BorderSizePixel = 0
    IntroFrame.Parent = IntroGui
    
    local IntroText = Instance.new("TextLabel")
    IntroText.Size = UDim2.new(1, 0, 1, 0)
    IntroText.BackgroundTransparency = 1
    IntroText.Text = "BY WFSBRO"
    IntroText.TextColor3 = Color3.new(1, 1, 1)
    IntroText.Font = Enum.Font.GothamBold
    IntroText.TextSize = 24
    IntroText.Parent = IntroFrame
    
    -- Запускаем музыку
    local introSound = Instance.new("Sound")
    introSound.SoundId = "rbxassetid://6350854289"
    introSound.Volume = 0.5
    introSound.Parent = SoundService
    introSound:Play()
    
    -- Через 3 секунды убираем всё
    wait(3)
    IntroGui:Destroy()
    introSound:Stop()
    introSound:Destroy()
end

-- Функция создания рига (палочек в руках)
local function createRig()
    local character = getCharacter()
    if not character then return end
    
    -- Создаем левую палочку
    LeftRigPart = Instance.new("Part")
    LeftRigPart.Name = "LeftRigStick"
    LeftRigPart.Size = Vector3.new(0.2, 2.0, 0.2) -- Длина 2.0
    LeftRigPart.BrickColor = BrickColor.new("Medium stone grey")
    LeftRigPart.Material = Enum.Material.Neon
    LeftRigPart.CanCollide = false
    LeftRigPart.Anchored = false
    LeftRigPart.Parent = workspace
    
    -- Создаем правую палочку
    RightRigPart = Instance.new("Part")
    RightRigPart.Name = "RightRigStick"
    RightRigPart.Size = Vector3.new(0.2, 2.0, 0.2) -- Длина 2.0
    RightRigPart.BrickColor = BrickColor.new("Medium stone grey")
    RightRigPart.Material = Enum.Material.Neon
    RightRigPart.CanCollide = false
    RightRigPart.Anchored = false
    RightRigPart.Parent = workspace
    
    -- Создаем Weld для левой палочки (прикрепляем к левой руке)
    local leftWeld = Instance.new("Weld")
    leftWeld.Part0 = character:FindFirstChild("Left Arm")
    leftWeld.Part1 = LeftRigPart
    leftWeld.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) -- Вертикально в центре руки
    leftWeld.Parent = LeftRigPart
    
    -- Создаем Weld для правой палочки (прикрепляем к правой руке)
    local rightWeld = Instance.new("Weld")
    rightWeld.Part0 = character:FindFirstChild("Right Arm")
    rightWeld.Part1 = RightRigPart
    rightWeld.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) -- Вертикально в центре руки
    rightWeld.Parent = RightRigPart
end

-- Функция удаления рига
local function removeRig()
    RigVisible = false
    if RigConnection then
        RigConnection:Disconnect()
        RigConnection = nil
    end
    if LeftRigPart then
        LeftRigPart:Destroy()
        LeftRigPart = nil
    end
    if RightRigPart then
        RightRigPart:Destroy()
        RightRigPart = nil
    end
end

-- Функция переключения рига
local function toggleRig()
    if RigButton.Text == "SHOW RIG" then
        -- Показываем риг
        RigVisible = true
        createRig()
        RigButton.Text = "HIDE RIG"
        RigButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3)
    else
        -- Скрываем риг
        removeRig()
        RigButton.Text = "SHOW RIG"
        RigButton.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5)
    end
end

-- Функция убийства персонажа
local function killCharacter()
    local character = getCharacter()
    if character and character:FindFirstChild("Humanoid") then
        character.Humanoid.Health = 0
    end
end

-- Функция запуска VR скрипта
local function StartVRScript()
    if VRScriptActive then return end
    
    -- Проверяем R6/R15
    if not isR6() then
        VRButton.Text = "R15 ERROR"
        VRButton.BackgroundColor3 = Color3.new(0.8, 0, 0)
        wait(2)
        VRButton.Text = "START VR"
        VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
        return
    end
    
    -- Проверяем, есть ли живой персонаж
    local character = getCharacter()
    if not character then
        VRButton.Text = "NO CHARACTER"
        VRButton.BackgroundColor3 = Color3.new(0.8, 0, 0)
        wait(2)
        VRButton.Text = "START VR"
        VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
        return
    end
    
    -- Показываем интро и музыку
    showIntro()
    
    -- Запускаем VR скрипт
    VRScriptActive = true
    VRButton.Text = "STOP VR"
    VRButton.BackgroundColor3 = Color3.new(0.8, 0, 0)
    
    -- Создаем VR GUI
    VRScreenGui = Instance.new("ScreenGui")
    VRScreenGui.Name = "FakeVR_GUI"
    VRScreenGui.ResetOnSpawn = false
    VRScreenGui.Parent = PlayerGui
    
    local player = game.Players.LocalPlayer
    local runService = game:GetService("RunService")
    
    -- === Настройки ===
    local GUI_SIZE = 150
    local INNER_SIZE = 40
    local ROTATION_ANGLE = 180
    local UPDOWN_ANGLE = 120
    local SMOOTHNESS = 0.3
    
    -- === GUI ===
    local function makeZone(color, posX)
        local frame = Instance.new("Frame")
        frame.Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE)
        frame.Position = UDim2.new(posX, -GUI_SIZE/2, 0.8, -GUI_SIZE/2)
        frame.BackgroundColor3 = color
        frame.BorderSizePixel = 2
        frame.Parent = VRScreenGui
        
        local inner = Instance.new("Frame")
        inner.Size = UDim2.new(0, INNER_SIZE, 0, INNER_SIZE)
        inner.Position = UDim2.new(0.5, -INNER_SIZE/2, 0.5, -INNER_SIZE/2)
        inner.BackgroundColor3 = Color3.new(1,1,1)
        inner.Active = true
        inner.Draggable = true
        inner.Parent = frame
        
        return frame, inner
    end
    
    local redZone, redSquare = makeZone(Color3.fromRGB(255,0,0), 0.3)
    local blueZone, blueSquare = makeZone(Color3.fromRGB(0,0,255), 0.7)
    
    -- === Персонаж ===
    local character = getCharacter()
    if not character then
        -- Если персонаж умер во время запуска, отключаем VR
        VRScriptActive = false
        VRButton.Text = "START VR"
        VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
        VRScreenGui:Destroy()
        return
    end
    
    local humanoid = character:WaitForChild("Humanoid")
    
    -- Отключаем стандартные анимации
    local animator = humanoid:FindFirstChildOfClass("Animator")
    if animator then animator:Destroy() end
    for _, a in ipairs(humanoid:GetChildren()) do
        if a:IsA("Animation") then a:Destroy() end
    end
    
    local torso = character:WaitForChild("Torso")
    local leftShoulder = torso:WaitForChild("Left Shoulder")
    local rightShoulder = torso:WaitForChild("Right Shoulder")
    
    -- Базовые положения плеч
    local leftBase = leftShoulder.C0
    local rightBase = rightShoulder.C0
    
    -- === Преобразование GUI → углы ===
    local function guiToRotation(square, zone)
        local zoneAbs = zone.AbsoluteSize
        local squareAbs = square.AbsolutePosition - zone.AbsolutePosition
        
        -- центр зоны
        local centerX, centerY = zoneAbs.X / 2, zoneAbs.Y / 2
        
        -- отклонение от центра (в долях)
        local relX = (squareAbs.X + INNER_SIZE/2 - centerX) / zoneAbs.X
        local relY = (squareAbs.Y + INNER_SIZE/2 - centerY) / zoneAbs.Y
        
        -- Чем дальше от центра — тем сильнее вращение
        local yaw = math.rad(relX * ROTATION_ANGLE)
        local pitch = math.rad(relY * UPDOWN_ANGLE)
        
        return yaw, pitch
    end
    
    -- Плавность
    local leftCurrent = CFrame.new()
    local rightCurrent = CFrame.new()
    local leftTarget = CFrame.new()
    local rightTarget = CFrame.new()
    
    -- === Основной цикл ===
    VRConnection = runService.RenderStepped:Connect(function()
        if not VRScriptActive then
            VRConnection:Disconnect()
            return
        end
        
        -- Проверяем, жив ли персонаж
        local currentCharacter = getCharacter()
        if not currentCharacter then
            -- Персонаж умер, отключаем VR
            VRScriptActive = false
            VRButton.Text = "START VR"
            VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
            if VRScreenGui then
                VRScreenGui:Destroy()
                VRScreenGui = nil
            end
            VRConnection:Disconnect()
            return
        end
        
        if not (leftShoulder and rightShoulder) then return end
        
        local lyaw, lpitch = guiToRotation(redSquare, redZone)
        local ryaw, rpitch = guiToRotation(blueSquare, blueZone)
        
        leftTarget = CFrame.Angles(lpitch, 0, lyaw)
        rightTarget = CFrame.Angles(rpitch, 0, ryaw)
        
        leftCurrent = leftCurrent:Lerp(leftTarget, 1 - SMOOTHNESS)
        rightCurrent = rightCurrent:Lerp(rightTarget, 1 - SMOOTHNESS)
        
        leftShoulder.C0 = leftBase * leftCurrent
        rightShoulder.C0 = rightBase * rightCurrent
    end)
end

-- Функция остановки VR скрипта и убийства персонажа
local function StopVRScript()
    -- Убиваем персонажа
    killCharacter()
    
    -- Отключаем VR скрипт
    VRScriptActive = false
    VRButton.Text = "START VR"
    VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
    
    if VRScreenGui then
        VRScreenGui:Destroy()
        VRScreenGui = nil
    end
    
    if VRConnection then
        VRConnection:Disconnect()
    end
end

-- Функция для Gamepasses
local function LoadGamepasses()
    local function SlicerX(func)
        local success, result = pcall(func)
        if not success then
            warn("[SlicerX ERROR]:", result)
        end
        return success, result
    end

    SlicerX(function()
        loadstring(game:HttpGet("https://raw.githubusercontent.com/Ahma174/Fake-Gamepasses/refs/heads/main/V5"))()
    end)
end

-- Обработчик кнопки START VR / STOP VR
VRButton.MouseButton1Click:Connect(function()
    if VRButton.Text == "START VR" then
        -- Запускаем VR скрипт
        StartVRScript()
    else
        -- Останавливаем VR скрипт и убиваем персонажа
        StopVRScript()
    end
end)

-- Обработчик кнопки GAMEPASSES
GamepassesButton.MouseButton1Click:Connect(function()
    LoadGamepasses()
    GamepassesButton.Text = "LOADED!"
    GamepassesButton.BackgroundColor3 = Color3.new(0, 0.8, 0)
    wait(2)
    GamepassesButton.Text = "GAMEPASSES"
    GamepassesButton.BackgroundColor3 = Color3.new(0, 0.3, 0.8)
end)

-- Обработчик кнопки SHOW RIG / HIDE RIG
RigButton.MouseButton1Click:Connect(toggleRig)

-- Обработчик смерти персонажа
LocalPlayer.CharacterAdded:Connect(function(character)
    -- Ждем появления Humanoid
    local humanoid = character:WaitForChild("Humanoid")
    
    -- Следим за здоровьем персонажа
    humanoid.Died:Connect(function()
        -- При смерти отключаем VR скрипт и риг
        VRScriptActive = false
        RigVisible = false
        VRButton.Text = "START VR"
        VRButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
        RigButton.Text = "SHOW RIG"
        RigButton.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5)
        
        if VRScreenGui then
            VRScreenGui:Destroy()
            VRScreenGui = nil
        end
        
        if VRConnection then
            VRConnection:Disconnect()
        end
        
        removeRig()
    end)
end)

print("VR Controller GUI loaded! (R15 protection + Intro + Rig with 2.0 length)")

Features & Information

vr controller

Community Comments (5)

KillaKillaOct 30, 2025

chatgpt

Replying to @Killa
ZorvixaZorvixaOct 30, 2025(edited)

@Killa he didn't make it he just found it

WuzRERBornWuzRERBornOct 30, 2025

is this FE?

Replying to @WuzRERBorn
ZezorgotbannedZezorgotbannedOct 30, 2025

@WuzRERBorn cilent

WFSBROWFSBRODec 30, 2025

HEY YOU, THAT IS MY SCRIPT AND YOU JUST STOLE IT!

More Scripts for Universal Scripts