Advertisement
Upscalefanatic3

[FE] (Roblox) Toronto Raptors VR

Mar 3rd, 2020
6,842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. TORONTO RAPTORS VR
  3.  
  4. Toronto Raptors VR Script.
  5.  
  6. Having a headset is optional.
  7. Please wear at least 6 hats for a full character.
  8. The Raptors have filed a report with Roblox for a patch. Please have fun until it is patched very soon.
  9.  
  10. Visit us at the Secret Service base: https://www.roblox.com/games/2849758833/Try-on-Animations
  11. Join the Raptors fan server! discord.gg/yyHFXwr
  12. ]]
  13.  
  14. local s = Instance.new("Sound",game.CoreGui)
  15. s.SoundId = "rbxassetid://1349857767"
  16. s.Volume = 1
  17. s:Play()
  18.  
  19. --|| Controls:
  20.  
  21. -- [ R2 ]   - Sprint
  22. -- [ L2 ]   - Crouch
  23.  
  24. -- [ Y ]    - Reset - Used mainly to reset after RagdollEnabled
  25. -- [ B ]    - Laser Beam
  26. -- [ X ]    - Toggle Chat HUD - Left hand
  27.  
  28. -- Default Roblox VR controls are included
  29.  
  30. --|| Settings:
  31.  
  32. local StudsOffset = 0 -- Character height (negative if you're too high)
  33. local Smoothness = .5 -- Character interpolation (0.1 - 1 = smooth - rigid)
  34.  
  35. local AnchorCharacter = true -- Prevent physics from causing inconsistencies (Keep this on for accurate tool positioning)
  36. local HideCharacter = false -- Hide character on a platform
  37. local NoCollision = true -- Disable player collision
  38.  
  39. local ChatEnabled = true -- See chat on your left hand in-game (Toggle with
  40.  local ChatLocalRange = 50 -- Local chat range
  41.  
  42. local ViewportEnabled = true -- View nearby players in a frame
  43.  local ViewportRange = 64 -- Maximum distance players are updated
  44.  
  45. local RagdollEnabled = false -- Use your character instead of hats (NetworkOwner vulnerability)
  46.  local RagdollHeadMovement = true -- Move your head separately from your body (+9 second wait)
  47.  
  48. local AutoRun = false -- Run script on respawn
  49. local AutoRespawn = true -- Kill your real body when your virtual body dies
  50.  
  51. local WearAllAccessories = true -- Use all leftover hats for the head
  52. local AccurateHandPosition = false -- Move your Roblox hands according to your real hands
  53.  
  54. local AccessorySettings = {
  55.     LeftArm     = ""; -- Name of hat used as this limb
  56.     RightArm    = ""; -- Name of hat used as this limb
  57.     LeftLeg     = ""; -- Name of hat used as this limb
  58.     RightLeg    = ""; -- Name of hat used as this limb
  59.     Torso       = ""; -- Name of hat used as this limb
  60.     Head        = true; -- Are extra hats assumed to be your head?
  61.    
  62.     BlockArms   = true; -- Remove accessory meshes of this limb
  63.     BlockLegs   = true; -- Remove accessory meshes of this limb
  64.     BlockTorso  = true; -- Remove accessory meshes of this limb
  65.    
  66.     LimbOffset  = CFrame.Angles(math.rad(90), 0, 0); -- Don't touch
  67. }
  68.  
  69. local FootPlacementSettings = {
  70.     RightOffset = Vector3.new(.5, 0, 0),
  71.     LeftOffset = Vector3.new(-.5, 0, 0),
  72. }
  73.  
  74. --|| Script:
  75.  
  76. local hatPicker = (function()
  77.     local function CreateInstance(class,props)
  78.         local obj = Instance.new(class)
  79.         for i,v in pairs(props) do
  80.             obj[i] = v
  81.         end
  82.         return obj
  83.     end
  84.    
  85.     local function createVRGui()
  86.         local VRGui = CreateInstance("ScreenGui",{DisplayOrder=0,Enabled=true,ResetOnSpawn=true,Name="HatPicker",})
  87.         local VRGui2 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.2352941185236,0.2352941185236,0.2352941185236),BackgroundTransparency=0,BorderColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.5,-110,0.5,-150),Rotation=0,Selectable=false,Size=UDim2.new(0,220,0,300),SizeConstraint=0,Visible=true,ZIndex=1,Name="Frame",Parent = VRGui})
  88.         local VRGui3 = CreateInstance("TextLabel",{Font=3,FontSize=7,Text="Toronto Raptors VR",TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,50,0,10),Rotation=0,Selectable=false,Size=UDim2.new(1,-50,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Title",Parent = VRGui2})
  89.         local VRGui4 = CreateInstance("ImageLabel",{Image="http://www.roblox.com/asset/?id=3036990720",ImageColor3=Color3.new(1,1,1),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,50,0,50),SizeConstraint=0,Visible=true,ZIndex=1,Name="ImageLabel",Parent = VRGui2})
  90.         local VRGui5 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Let's go Raptors! Please wear at least 6 hats! Pick the hat to use for the following part:",TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=16,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,55),Rotation=0,Selectable=false,Size=UDim2.new(1,-10,0,48),SizeConstraint=0,Visible=true,ZIndex=1,Name="Desc",Parent = VRGui2})
  91.         local VRGui6 = CreateInstance("TextLabel",{Font=3,FontSize=11,Text="",TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=32,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,105),Rotation=0,Selectable=false,Size=UDim2.new(1,-10,0,32),SizeConstraint=0,Visible=true,ZIndex=1,Name="HatName",Parent = VRGui2})
  92.         local VRGui7 = CreateInstance("ScrollingFrame",{BottomImage="rbxasset://textures/ui/Scroll/scroll-bottom.png",CanvasPosition=Vector2.new(0,0),CanvasSize=UDim2.new(0,0,2,0),MidImage="rbxasset://textures/ui/Scroll/scroll-middle.png",ScrollBarThickness=12,ScrollingEnabled=true,TopImage="rbxasset://textures/ui/Scroll/scroll-top.png",Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.2352941185236,0.2352941185236,0.2352941185236),BackgroundTransparency=0,BorderColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),BorderSizePixel=1,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,0,0,140),Rotation=0,Selectable=true,Size=UDim2.new(1,0,1,-180),SizeConstraint=0,Visible=true,ZIndex=1,Name="HatList",Parent = VRGui2})
  93.         local VRGui8 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text=[==[Keyboard Controls:
  94.     Q - Up | E - Down | Enter - Select Hat]==],TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=15,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,260),Rotation=0,Selectable=false,Size=UDim2.new(1,-17,0,40),SizeConstraint=0,Visible=true,ZIndex=1,Name="Controls",Parent = VRGui2})
  95.         return VRGui
  96.     end
  97.    
  98.     local gui = createVRGui()
  99.     gui.Parent = game:GetService("CoreGui")
  100.     local frame = gui:WaitForChild("Frame")
  101.     local list = frame:WaitForChild("HatList")
  102.     local hatName = frame:WaitForChild("HatName")
  103.     local plr = game:GetService("Players").LocalPlayer
  104.     local char = plr.Character
  105.    
  106.     local function getHats()
  107.         local hats = {}
  108.         for i,v in pairs(char:GetChildren()) do
  109.             if v:IsA("Accoutrement") then
  110.                 hats[#hats+1] = v
  111.             end
  112.         end
  113.         return hats
  114.     end
  115.     local hats = getHats()
  116.    
  117.     local function pickHat(name)
  118.         if not char then frame.Visible = false return "" end
  119.        
  120.         if #hats == 0 then frame.Visible = false return "" end
  121.        
  122.         list:ClearAllChildren()
  123.         hatName.Text = name
  124.        
  125.         local user = game:GetService("UserInputService")
  126.         local selected = 1
  127.        
  128.         local function updateHats()
  129.             for i,v in pairs(list:GetChildren()) do
  130.                 if i == selected then
  131.                     v.BackgroundColor3 = Color3.fromRGB(90,90,90)
  132.                 else
  133.                     v.BackgroundColor3 = Color3.fromRGB(70,70,70)
  134.                 end
  135.             end
  136.             list.CanvasPosition = Vector2.new(0,(selected-1)*20)
  137.         end
  138.        
  139.         local choice = nil
  140.         for i,v in pairs(hats) do
  141.             local but = Instance.new("TextButton")
  142.             but.BackgroundColor3 = Color3.fromRGB(70,70,70)
  143.             but.BorderSizePixel = 0
  144.             but.Size = UDim2.new(1,-5,0,20)
  145.             but.Text = v.Name
  146.             but.Position = UDim2.new(0,5,0,#list:GetChildren()*20)
  147.             but.TextColor3 = Color3.new(1,1,1)
  148.             but.MouseButton1Click:Connect(function()
  149.                 choice = v.Name
  150.                 for a,b in pairs(hats) do if b.Name == v.Name then table.remove(hats,a) break end end
  151.             end)
  152.             but.Parent = list
  153.         end
  154.         list.CanvasSize = UDim2.new(1,0,0,#list:GetChildren()*20)
  155.        
  156.         updateHats()
  157.        
  158.         local con
  159.         con = user.InputBegan:Connect(function(input)
  160.             if input.KeyCode == Enum.KeyCode.Q then
  161.                 if selected > 1 then
  162.                     selected = selected - 1
  163.                     updateHats()
  164.                 end
  165.             elseif input.KeyCode == Enum.KeyCode.E then
  166.                 if selected < #list:GetChildren() then
  167.                     selected = selected + 1
  168.                     updateHats()
  169.                 end
  170.             elseif input.KeyCode == Enum.KeyCode.Return then
  171.                 choice = list:GetChildren()[selected].Text
  172.                 for a,b in pairs(hats) do if b.Name == choice then table.remove(hats,a) break end end
  173.             end
  174.         end)
  175.        
  176.         frame.Visible = true
  177.        
  178.         while not choice do wait() end
  179.         con:Disconnect()
  180.        
  181.         frame.Visible = false
  182.        
  183.         return choice
  184.     end
  185.    
  186.     return pickHat
  187. end)()
  188.  
  189. if not RagdollEnabled then
  190.     AccessorySettings.LeftArm = hatPicker("Left Arm")
  191.     AccessorySettings.RightArm = hatPicker("Right Arm")
  192.     AccessorySettings.LeftLeg = hatPicker("Left Leg")
  193.     AccessorySettings.RightLeg = hatPicker("Right Leg")
  194.     AccessorySettings.Torso = hatPicker("Torso")
  195. end
  196.  
  197. local Script = nil;
  198.  
  199. -- My coding style changed throughout this a lot lol
  200.  
  201. Script = function()
  202.  
  203. --[[
  204.     Variables
  205. --]]
  206.  
  207. local Players = game:GetService("Players")
  208.  local Client = Players.LocalPlayer
  209.   local Character = Client.Character or Client.CharacterAdded:Wait()
  210.    local WeldBase = Character:WaitForChild("HumanoidRootPart")
  211.    local ArmBase = Character:FindFirstChild("RightHand") or Character:FindFirstChild("Right Arm") or WeldBase
  212.   local Backpack = Client:WaitForChild("Backpack")
  213.   local Mouse = Client:GetMouse()
  214.  
  215. local Camera = workspace.CurrentCamera
  216.  
  217. local VRService = game:GetService("VRService")
  218.  local VRReady = VRService.VREnabled
  219.  
  220. local UserInputService = game:GetService("UserInputService")
  221. local RunService = game:GetService("RunService")
  222. local HttpService = game:GetService("HttpService")
  223. local StarterGui = game:GetService("StarterGui")   
  224.  
  225. local HeadAccessories = {};
  226. local UsedAccessories = {};
  227.  
  228. local Pointer = false;
  229. local Point1 = false;
  230. local Point2 = false;
  231.  
  232. local VirtualRig = game:GetObjects("rbxassetid://4649966982")[1]
  233. local VirtualBody = game:GetObjects("rbxassetid://4649969493")[1]
  234.  
  235. local Anchor = Instance.new("Part")
  236.  
  237. Anchor.Anchored = true
  238. Anchor.Transparency = 1
  239. Anchor.CanCollide = false
  240. Anchor.Parent = workspace
  241.  
  242. if RagdollEnabled then
  243.     --[[if script:FindFirstChild("Network") then
  244.         Network = require(script.Network)
  245.     else
  246.         Network = loadstring(game:HttpGet("https://pastebin.com/raw/FuKhxp7Q", true))()
  247.     end]]
  248.     Network = (function()
  249.         --[[
  250.             Variables
  251.         --]]
  252.        
  253.         local Players = game:GetService("Players")
  254.          local Client = Players.LocalPlayer
  255.        
  256.         local Settings = settings()
  257.          local Network = Settings:GetService("NetworkSettings")
  258.          local Physics = Settings:GetService("PhysicsSettings")
  259.        
  260.         local Module = {};
  261.        
  262.         local Enabled = false
  263.        
  264.         local Default = {
  265.             DataSendPriority = Network.DataSendPriority;
  266.             PhysicsSendPriority = Network.PhysicsSendPriority;
  267.             NetworkOwnerRate = Network.NetworkOwnerRate;
  268.         };
  269.        
  270.         --[[
  271.             Code
  272.         --]]
  273.        
  274.         function Module:Claim()
  275.             Network.DataSendPriority = Enum.PacketPriority.IMMEDIATE_PRIORITY
  276.             Network.PhysicsSendPriority = Enum.PacketPriority.IMMEDIATE_PRIORITY
  277.            
  278.             Network.NetworkOwnerRate = 0
  279.            
  280.             Physics.AllowSleep = false
  281.            
  282.             Client.MaximumSimulationRadius = 100000
  283.             Client.SimulationRadius = 100000
  284.            
  285.             for _, Player in pairs(Players:GetPlayers()) do
  286.                 if Player ~= Client then
  287.                     Player.MaximumSimulationRadius = 0
  288.                     Player.SimulationRadius = 0
  289.                 end
  290.             end
  291.            
  292.             Enabled = true
  293.         end
  294.        
  295.         function Module:Unclaim()
  296.             Network.DataSendPriority = Default.DataSendPriority
  297.             Network.PhysicsSendPriority = Default.PhysicsSendPriority
  298.            
  299.             Network.NetworkOwnerRate = Default.NetworkOwnerRate
  300.            
  301.             Physics.AllowSleep = true
  302.            
  303.             for _, Player in pairs(Players:GetPlayers()) do
  304.                 Player.MaximumSimulationRadius = 10
  305.                 Player.SimulationRadius = 1000
  306.             end
  307.            
  308.             Enabled = false
  309.         end
  310.        
  311.         Players.PlayerAdded:Connect(function(Player)
  312.             if Enabled then
  313.                 Player.MaximumSimulationRadius = 0
  314.                 Player.SimulationRadius = 0
  315.             end
  316.         end)
  317.        
  318.         --[[
  319.             Modularization
  320.         --]]
  321.        
  322.         return Module
  323.     end)()
  324.     Network:Claim();
  325. end
  326.  
  327. StarterGui:SetCore("VRLaserPointerMode", 3)
  328.  
  329. --[[
  330.     Character Protection
  331. --]]
  332.  
  333. local CharacterCFrame = WeldBase.CFrame
  334.  
  335. if not RagdollEnabled then
  336.     Character.Humanoid.AnimationPlayed:Connect(function(Animation)
  337.         Animation:Stop()
  338.     end)
  339.    
  340.     for _, Track in next, Character.Humanoid:GetPlayingAnimationTracks() do
  341.         Track:Stop()
  342.     end
  343.  
  344.     wait(.5)
  345.    
  346.     if HideCharacter then
  347.         local Platform = Instance.new("Part")
  348.        
  349.         Platform.Anchored = true
  350.         Platform.Size = Vector3.new(100, 5, 100)
  351.         Platform.CFrame = CFrame.new(0, 10000, 0)
  352.         Platform.Transparency = 1
  353.         Platform.Parent = workspace
  354.        
  355.         Character:MoveTo(Platform.Position + Vector3.new(0, 5, 0))
  356.        
  357.         wait(.5)
  358.     end
  359.    
  360.     if AnchorCharacter then
  361.         for _, Part in pairs(Character:GetChildren()) do
  362.             if Part:IsA("BasePart") then
  363.                 Part.Anchored = true
  364.             end
  365.         end
  366.     end
  367. end
  368.  
  369. --[[
  370.     Functions
  371. --]]
  372.  
  373. function Tween(Object, Style, Direction, Time, Goal)
  374.     local tweenInfo = TweenInfo.new(Time, Enum.EasingStyle[Style], Enum.EasingDirection[Direction])
  375.     local tween = game:GetService("TweenService"):Create(Object, tweenInfo, Goal)
  376.  
  377.     tween.Completed:Connect(function()
  378.         tween:Destroy()
  379.     end)
  380.    
  381.     tween:Play()
  382.  
  383.     return tween
  384. end
  385.  
  386. local function GetMotorForLimb(Limb)
  387.     for _, Motor in next, Character:GetDescendants() do
  388.         if Motor:IsA("Motor6D") and Motor.Part1 == Limb then
  389.             return Motor
  390.         end
  391.     end
  392. end
  393.  
  394. local function CreateAlignment(Limb, Part0)
  395.     local Attachment0 = Instance.new("Attachment", Part0 or Anchor)
  396.     local Attachment1 = Instance.new("Attachment", Limb)
  397.    
  398.     local Orientation = Instance.new("AlignOrientation")
  399.     local Position = Instance.new("AlignPosition")
  400.    
  401.     Orientation.Attachment0 = Attachment1
  402.     Orientation.Attachment1 = Attachment0
  403.     Orientation.RigidityEnabled = false
  404.     Orientation.MaxTorque = 20000
  405.     Orientation.Responsiveness = 40
  406.     Orientation.Parent = Character.HumanoidRootPart
  407.    
  408.     Position.Attachment0 = Attachment1
  409.     Position.Attachment1 = Attachment0
  410.     Position.RigidityEnabled = false
  411.     Position.MaxForce = 40000
  412.     Position.Responsiveness = 40
  413.     Position.Parent = Character.HumanoidRootPart
  414.    
  415.     Limb.Massless = false
  416.    
  417.     local Motor = GetMotorForLimb(Limb)
  418.     if Motor then
  419.         Motor:Destroy()
  420.     end
  421.    
  422.     return function(CF, Local)
  423.         if Local then
  424.             Attachment0.CFrame = CF
  425.         else
  426.             Attachment0.WorldCFrame = CF
  427.         end
  428.     end;
  429. end
  430.  
  431. local function GetExtraTool()
  432.     for _, Tool in next, Character:GetChildren() do
  433.         if Tool:IsA("Tool") and not Tool.Name:match("LIMB_TOOL") then
  434.             return Tool
  435.         end
  436.     end
  437. end
  438.  
  439. local function GetGripForHandle(Handle)
  440.     for _, Weld in next, Character:GetDescendants() do
  441.         if Weld:IsA("Weld") and (Weld.Part0 == Handle or Weld.Part1 == Handle) then
  442.             return Weld
  443.         end
  444.     end
  445.    
  446.     wait(.2)
  447.    
  448.     for _, Weld in next, Character:GetDescendants() do
  449.         if Weld:IsA("Weld") and (Weld.Part0 == Handle or Weld.Part1 == Handle) then
  450.             return Weld
  451.         end
  452.     end
  453. end
  454.  
  455. local function CreateRightGrip(Handle)
  456.     local RightGrip = Instance.new("Weld")
  457.    
  458.     RightGrip.Name = "RightGrip"
  459.     RightGrip.Part1 = Handle
  460.     RightGrip.Part0 = WeldBase
  461.     RightGrip.Parent = WeldBase
  462.    
  463.     return RightGrip
  464. end
  465.  
  466. local function CreateAccessory(Accessory, DeleteMeshes)
  467.     if not Accessory then
  468.         return
  469.     end
  470.    
  471.     local HatAttachment = Accessory.Handle:FindFirstChildWhichIsA("Attachment")
  472.     local HeadAttachment = VirtualRig:FindFirstChild(HatAttachment.Name, true)
  473.     local BasePart = HeadAttachment.Parent
  474.    
  475.     local HatAtt = HatAttachment.CFrame
  476.     local HeadAtt = HeadAttachment.CFrame
  477.    
  478.     if DeleteMeshes then
  479.         if Accessory.Handle:FindFirstChild("Mesh") then
  480.             Accessory.Handle.Mesh:Destroy()
  481.         end
  482.     end
  483.    
  484.     wait()
  485.    
  486.     local Handle = Accessory:WaitForChild("Handle")
  487.    
  488.     if Handle:FindFirstChildWhichIsA("Weld", true) then
  489.         Handle:FindFirstChildWhichIsA("Weld", true):Destroy()
  490.         Handle:BreakJoints()
  491.     else
  492.         Handle:BreakJoints()
  493.     end
  494.    
  495.     Handle.Massless = true
  496.     Handle.Transparency = 0.5
  497.    
  498.     UsedAccessories[Accessory] = true
  499.    
  500.     local RightGrip = CreateRightGrip(Handle)
  501.    
  502.     wait()
  503.    
  504.     for _, Object in pairs(Handle:GetDescendants()) do
  505.         if not Object:IsA("BasePart") then
  506.             pcall(function()
  507.                 Object.Transparency = 1
  508.             end)
  509.            
  510.             pcall(function()
  511.                 Object.Enabled = false
  512.             end)
  513.         end
  514.     end
  515.    
  516.     return Handle, RightGrip, HatAtt, HeadAtt, BasePart;
  517. end
  518.  
  519. local function GetHeadAccessories()
  520.     for _, Accessory in next, Character:GetChildren() do
  521.         if Accessory:IsA("Accessory") and not UsedAccessories[Accessory] then
  522.             local Handle, RightGrip, HatAtt, HeadAtt, BasePart = CreateAccessory(Accessory)
  523.            
  524.             table.insert(HeadAccessories, {Handle, RightGrip, HatAtt, HeadAtt, BasePart})
  525.            
  526.             do
  527.                 Handle.Transparency = 1
  528.             end
  529.            
  530.             if not WearAllAccessories then
  531.                 break
  532.             end
  533.         end
  534.     end
  535. end
  536.  
  537. --[[
  538.     VR Replication Setup
  539. --]]
  540.  
  541. if not RagdollEnabled then
  542.     LeftHandle, LeftHandGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.LeftArm), AccessorySettings.BlockArms)
  543.     RightHandle, RightHandGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.RightArm), AccessorySettings.BlockArms)
  544.     LeftHipHandle, LeftLegGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.LeftLeg), AccessorySettings.BlockLegs)
  545.     RightHipHandle, RightLegGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.RightLeg), AccessorySettings.BlockLegs)
  546.     TorsoHandle, TorsoGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.Torso), AccessorySettings.BlockTorso)
  547.     GetHeadAccessories()
  548.    
  549. elseif RagdollEnabled then
  550.     if RagdollHeadMovement then
  551.         Permadeath()
  552.         MoveHead = CreateAlignment(Character["Head"])
  553.     end
  554.    
  555.     MoveRightArm = CreateAlignment(Character["Right Arm"])
  556.     MoveLeftArm = CreateAlignment(Character["Left Arm"])
  557.     MoveRightLeg = CreateAlignment(Character["Right Leg"])
  558.     MoveLeftLeg = CreateAlignment(Character["Left Leg"])
  559.     MoveTorso = CreateAlignment(Character["Torso"])
  560.     MoveRoot = CreateAlignment(Character.HumanoidRootPart)
  561.    
  562.     if RagdollHeadMovement then
  563.         for _, Accessory in next, Character:GetChildren() do
  564.             if Accessory:IsA("Accessory") and Accessory:FindFirstChild("Handle") then
  565.                 local Attachment1 = Accessory.Handle:FindFirstChildWhichIsA("Attachment")
  566.                 local Attachment0 = Character:FindFirstChild(tostring(Attachment1), true)
  567.                
  568.                 local Orientation = Instance.new("AlignOrientation")
  569.                 local Position = Instance.new("AlignPosition")
  570.                
  571.                 print(Attachment1, Attachment0, Accessory)
  572.                
  573.                 Orientation.Attachment0 = Attachment1
  574.                 Orientation.Attachment1 = Attachment0
  575.                 Orientation.RigidityEnabled = false
  576.                 Orientation.ReactionTorqueEnabled = true
  577.                 Orientation.MaxTorque = 20000
  578.                 Orientation.Responsiveness = 40
  579.                 Orientation.Parent = Character.Head
  580.                
  581.                 Position.Attachment0 = Attachment1
  582.                 Position.Attachment1 = Attachment0
  583.                 Position.RigidityEnabled = false
  584.                 Position.ReactionForceEnabled = true
  585.                 Position.MaxForce = 40000
  586.                 Position.Responsiveness = 40
  587.                 Position.Parent = Character.Head
  588.             end
  589.         end
  590.     end
  591. end
  592.  
  593. --[[
  594.     Movement
  595. --]]
  596.  
  597. VirtualRig.Name = "VirtualRig"
  598. VirtualRig.RightFoot.BodyPosition.Position = CharacterCFrame.p
  599. VirtualRig.LeftFoot.BodyPosition.Position = CharacterCFrame.p
  600. VirtualRig.Parent = workspace
  601. VirtualRig:SetPrimaryPartCFrame(CharacterCFrame)
  602.  
  603. VirtualRig.Humanoid.Health = 0
  604. VirtualRig:BreakJoints()
  605. --
  606.  
  607. VirtualBody.Parent = workspace
  608. VirtualBody.Name = "VirtualBody"
  609. VirtualBody.Humanoid.WalkSpeed = 8
  610. VirtualBody.Humanoid.CameraOffset = Vector3.new(0, StudsOffset, 0)
  611. VirtualBody:SetPrimaryPartCFrame(CharacterCFrame)
  612.  
  613. VirtualBody.Humanoid.Died:Connect(function()
  614.     print("Virtual death")
  615.     if AutoRespawn then
  616.         Character:BreakJoints()
  617.        
  618.         if RagdollHeadMovement and RagdollEnabled then
  619.             Network:Unclaim()
  620.             Respawn()
  621.         end
  622.     end
  623. end)
  624. --
  625.  
  626. Camera.CameraSubject = VirtualBody.Humanoid
  627.  
  628. Character.Humanoid.WalkSpeed = 0
  629. Character.Humanoid.JumpPower = 1
  630.  
  631. for _, Part in next, VirtualBody:GetChildren() do
  632.     if Part:IsA("BasePart") then
  633.         Part.Transparency = 1
  634.     end
  635. end
  636.  
  637. for _, Part in next, VirtualRig:GetChildren() do
  638.     if Part:IsA("BasePart") then
  639.         Part.Transparency = 1
  640.     end
  641. end
  642.  
  643. if not VRReady then
  644.     VirtualRig.RightUpperArm.ShoulderConstraint.RigidityEnabled = true
  645.     VirtualRig.LeftUpperArm.ShoulderConstraint.RigidityEnabled = true
  646. end
  647.  
  648.  
  649. local OnMoving = RunService.Stepped:Connect(function()
  650.     local Direction = Character.Humanoid.MoveDirection
  651.     local Start = VirtualBody.HumanoidRootPart.Position
  652.     local Point = Start + Direction * 6
  653.    
  654.     VirtualBody.Humanoid:MoveTo(Point)
  655. end)
  656.  
  657. Character.Humanoid.Jumping:Connect(function()
  658.     VirtualBody.Humanoid.Jump = true
  659. end)
  660.  
  661. UserInputService.JumpRequest:Connect(function()
  662.     VirtualBody.Humanoid.Jump = true
  663. end)
  664.  
  665. --[[
  666.     VR Replication
  667. --]]
  668.  
  669. if RagdollEnabled then
  670.     for _, Part in pairs(Character:GetDescendants()) do
  671.         if Part:IsA("BasePart") and Part.Name == "Handle" and Part.Parent:IsA("Accessory") then
  672.             Part.LocalTransparencyModifier = 1
  673.         elseif Part:IsA("BasePart") and Part.Transparency < 0.5 then
  674.             Part.LocalTransparencyModifier = 0.5
  675.         end
  676.        
  677.         if not Part:IsA("BasePart") and not Part:IsA("AlignPosition") and not Part:IsA("AlignOrientation") then
  678.             pcall(function()
  679.                 Part.Transparency = 1
  680.             end)
  681.            
  682.             pcall(function()
  683.                 Part.Enabled = false
  684.             end)
  685.         end
  686.     end
  687. end
  688.  
  689. local FootUpdateDebounce = tick()
  690.  
  691. local function FloorRay(Part, Distance)
  692.     local Position = Part.CFrame.p
  693.     local Target = Position - Vector3.new(0, Distance, 0)
  694.     local Line = Ray.new(Position, (Target - Position).Unit * Distance)
  695.    
  696.     local FloorPart, FloorPosition, FloorNormal = workspace:FindPartOnRayWithIgnoreList(Line, {VirtualRig, VirtualBody, Character})
  697.    
  698.     if FloorPart then
  699.         return FloorPart, FloorPosition, FloorNormal, (FloorPosition - Position).Magnitude
  700.     else
  701.         return nil, Target, Vector3.new(), Distance
  702.     end
  703. end
  704.  
  705. local function Flatten(CF)
  706.     local X,Y,Z = CF.X,CF.Y,CF.Z
  707.     local LX,LZ = CF.lookVector.X,CF.lookVector.Z
  708.    
  709.     return CFrame.new(X,Y,Z) * CFrame.Angles(0,math.atan2(LX,LZ),0)
  710. end
  711.  
  712. local FootTurn = 1
  713.  
  714. local function FootReady(Foot, Target)
  715.     local MaxDist
  716.    
  717.     if Character.Humanoid.MoveDirection.Magnitude > 0 then
  718.         MaxDist = .5
  719.     else
  720.         MaxDist = 1
  721.     end
  722.    
  723.     local PastThreshold = (Foot.Position - Target.Position).Magnitude > MaxDist
  724.     local PastTick = tick() - FootUpdateDebounce >= 2
  725.    
  726.     if PastThreshold or PastTick then
  727.         FootUpdateDebounce = tick()
  728.     end
  729.    
  730.     return
  731.         PastThreshold
  732.     or
  733.         PastTick
  734. end
  735.  
  736. local function FootYield()
  737.     local RightFooting = VirtualRig.RightFoot.BodyPosition
  738.     local LeftFooting = VirtualRig.LeftFoot.BodyPosition
  739.     local LowerTorso = VirtualRig.LowerTorso
  740.    
  741.     local Yield = tick()
  742.    
  743.     repeat
  744.         RunService.Stepped:Wait()
  745.         if
  746.             (LowerTorso.Position - RightFooting.Position).Y > 4
  747.         or
  748.             (LowerTorso.Position - LeftFooting.Position).Y > 4
  749.         or
  750.             ((LowerTorso.Position - RightFooting.Position) * Vector3.new(1, 0, 1)).Magnitude > 4
  751.         or
  752.             ((LowerTorso.Position - LeftFooting.Position) * Vector3.new(1, 0, 1)).Magnitude > 4
  753.         then
  754.             break
  755.         end
  756.     until tick() - Yield >= .17
  757. end
  758.  
  759. local function UpdateFooting()
  760.     if not VirtualRig:FindFirstChild("LowerTorso") then
  761.         wait()
  762.         return
  763.     end
  764.    
  765.     local Floor, FloorPosition, FloorNormal, Dist = FloorRay(VirtualRig.LowerTorso, 3)
  766.    
  767.     Dist = math.clamp(Dist, 0, 5)
  768.    
  769.     local FootTarget =
  770.         VirtualRig.LowerTorso.CFrame *
  771.         CFrame.new(FootPlacementSettings.RightOffset) -
  772.         Vector3.new(0, Dist, 0) +
  773.         Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8) * 2
  774.    
  775.     if FootReady(VirtualRig.RightFoot, FootTarget) then
  776.         VirtualRig.RightFoot.BodyPosition.Position = FootTarget.p
  777.         VirtualRig.RightFoot.BodyGyro.CFrame = Flatten(VirtualRig.LowerTorso.CFrame)
  778.     end
  779.    
  780.     FootYield()
  781.    
  782.     local FootTarget =
  783.         VirtualRig.LowerTorso.CFrame *
  784.         CFrame.new(FootPlacementSettings.LeftOffset) -
  785.         Vector3.new(0, Dist, 0) +
  786.         Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8) * 2
  787.    
  788.     if FootReady(VirtualRig.LeftFoot, FootTarget) then
  789.         VirtualRig.LeftFoot.BodyPosition.Position = FootTarget.p
  790.         VirtualRig.LeftFoot.BodyGyro.CFrame = Flatten(VirtualRig.LowerTorso.CFrame)
  791.     end
  792. end
  793.  
  794. local function UpdateTorsoPosition()
  795.     if not RagdollEnabled then
  796.         if TorsoHandle then
  797.             local Positioning = VirtualRig.UpperTorso.CFrame
  798.            
  799.             if not TorsoGrip or not TorsoGrip.Parent then
  800.                 TorsoGrip = CreateRightGrip(TorsoHandle)
  801.             end
  802.            
  803.             local Parent = TorsoGrip.Parent
  804.            
  805.             TorsoGrip.C1 = CFrame.new()
  806.             TorsoGrip.C0 = TorsoGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * CFrame.new(0, -0.25, 0) * AccessorySettings.LimbOffset), Smoothness)
  807.             TorsoGrip.Parent = nil
  808.             TorsoGrip.Parent = Parent
  809.         end
  810.     else
  811.         local Positioning = VirtualRig.UpperTorso.CFrame
  812.        
  813.         MoveTorso(Positioning * CFrame.new(0, -0.25, 0))
  814.         MoveRoot(Positioning * CFrame.new(0, -0.25, 0))
  815.     end
  816. end
  817.  
  818. local function UpdateLegPosition()
  819.     if not RagdollEnabled then
  820.         if RightHipHandle then
  821.             local Positioning =
  822.                 VirtualRig.RightLowerLeg.CFrame
  823.                 : Lerp(VirtualRig.RightFoot.CFrame, 0.5)
  824.                 + Vector3.new(0, 0.5, 0)
  825.            
  826.             if not RightHipHandle or not RightHipHandle.Parent then
  827.                 RightLegGrip = CreateRightGrip(RightHipHandle)
  828.             end
  829.            
  830.             local Parent = RightLegGrip.Parent
  831.            
  832.             RightLegGrip.C1 = CFrame.new()
  833.             RightLegGrip.C0 = RightLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * AccessorySettings.LimbOffset), Smoothness)
  834.             RightLegGrip.Parent = nil
  835.             RightLegGrip.Parent = Parent
  836.         end
  837.        
  838.         if LeftHipHandle then
  839.             local Positioning =
  840.                 VirtualRig.LeftLowerLeg.CFrame
  841.                 : Lerp(VirtualRig.LeftFoot.CFrame, 0.5)
  842.                 + Vector3.new(0, 0.5, 0)
  843.            
  844.             if not LeftLegGrip or not LeftLegGrip.Parent then
  845.                 LeftLegGrip = CreateRightGrip(LeftHipHandle)
  846.             end
  847.            
  848.             local Parent = LeftLegGrip.Parent
  849.            
  850.             LeftLegGrip.C1 = CFrame.new()
  851.             LeftLegGrip.C0 = LeftLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * AccessorySettings.LimbOffset), Smoothness)
  852.             LeftLegGrip.Parent = nil
  853.             LeftLegGrip.Parent = Parent
  854.         end
  855.     else
  856.         do
  857.             local Positioning =
  858.                 VirtualRig.RightLowerLeg.CFrame
  859.                 : Lerp(VirtualRig.RightFoot.CFrame, 0.5)
  860.                 * CFrame.Angles(0, math.rad(180), 0)
  861.                 + Vector3.new(0, 0.5, 0)
  862.            
  863.             MoveRightLeg(Positioning)
  864.         end
  865.        
  866.         do
  867.             local Positioning =
  868.                 VirtualRig.LeftLowerLeg.CFrame
  869.                 : Lerp(VirtualRig.LeftFoot.CFrame, 0.5)
  870.                 * CFrame.Angles(0, math.rad(180), 0)
  871.                 + Vector3.new(0, 0.5, 0)
  872.            
  873.             MoveLeftLeg(Positioning)
  874.         end
  875.     end
  876. end
  877.  
  878. warn("VRReady is", VRReady)
  879.  
  880. local function OnUserCFrameChanged(UserCFrame, Positioning, IgnoreTorso)
  881.     local Positioning = Camera.CFrame * Positioning
  882.    
  883.     if not IgnoreTorso then
  884.         UpdateTorsoPosition()
  885.         UpdateLegPosition()
  886.     end
  887.    
  888.     if not RagdollEnabled then
  889.         if UserCFrame == Enum.UserCFrame.Head and AccessorySettings.Head then
  890.             for _, Table in next, HeadAccessories do
  891.                 local Handle, RightGrip, HatAtt, HeadAtt, BasePart = unpack(Table)
  892.                 local LocalPositioning = Positioning
  893.                
  894.                 if not RightGrip or not RightGrip.Parent then
  895.                     RightGrip = CreateRightGrip(Handle)
  896.                     Table[2] = RightGrip
  897.                 end
  898.                
  899.                 local Parent = RightGrip.Parent
  900.                
  901.                 if BasePart then
  902.                     LocalPositioning = BasePart.CFrame * HeadAtt
  903.                 end
  904.                
  905.                 RightGrip.C1 = HatAtt
  906.                 RightGrip.C0 = RightGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(LocalPositioning), Smoothness)
  907.                 RightGrip.Parent = nil
  908.                 RightGrip.Parent = Parent
  909.             end
  910.            
  911.         elseif RightHandle and UserCFrame == Enum.UserCFrame.RightHand and AccessorySettings.RightArm then
  912.             local HandPosition = Positioning
  913.             local LocalPositioning = Positioning
  914.            
  915.             if not RightHandGrip or not RightHandGrip.Parent then
  916.                 RightHandGrip = CreateRightGrip(RightHandle)
  917.             end
  918.            
  919.             if AccurateHandPosition then
  920.                 HandPosition = HandPosition * CFrame.new(0, 0, 1)
  921.             else
  922.                 HandPosition = HandPosition * CFrame.new(0, 0, .5)
  923.             end
  924.            
  925.             if not VRReady then
  926.                 local HeadRotation = Camera.CFrame - Camera.CFrame.p
  927.                
  928.                 HandPosition = VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5) * AccessorySettings.LimbOffset
  929.                
  930.                 --LocalPositioning = (HeadRotation + (HandPosition * CFrame.new(0, 0, 1)).p) * CFrame.Angles(math.rad(-45), 0, 0)
  931.                 LocalPositioning = HandPosition * CFrame.new(0, 0, 1) * CFrame.Angles(math.rad(-180), 0, 0)
  932.                
  933.                 if Point2 then
  934.                     VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  935.                     VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  936.                 elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  937.                     VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  938.                 end
  939.             elseif not AccurateHandPosition then
  940.                 LocalPositioning = HandPosition * CFrame.new(0, 0, -1)
  941.             end
  942.            
  943.             local Parent = RightHandGrip.Parent
  944.            
  945.             RightHandGrip.C1 = CFrame.new()
  946.             RightHandGrip.C0 = RightHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)
  947.             RightHandGrip.Parent = nil
  948.             RightHandGrip.Parent = Parent
  949.            
  950.             --
  951.            
  952.             local EquippedTool = GetExtraTool()
  953.            
  954.             if EquippedTool and EquippedTool:FindFirstChild("Handle") then
  955.                 local EquippedGrip = GetGripForHandle(EquippedTool.Handle)
  956.                 local Parent = EquippedGrip.Parent
  957.                
  958.                 local ArmBaseCFrame = ArmBase.CFrame
  959.                 if ArmBase.Name == "Right Arm" then
  960.                     ArmBaseCFrame = ArmBaseCFrame
  961.                 end
  962.                
  963.                 EquippedGrip.C1 = EquippedTool.Grip
  964.                 EquippedGrip.C0 = EquippedGrip.C0:Lerp(ArmBaseCFrame:ToObjectSpace(LocalPositioning), Smoothness)
  965.                 EquippedGrip.Parent = nil
  966.                 EquippedGrip.Parent = Parent
  967.             end
  968.            
  969.         elseif LeftHandle and UserCFrame == Enum.UserCFrame.LeftHand and AccessorySettings.LeftArm then
  970.             local HandPosition = Positioning
  971.            
  972.             if not LeftHandGrip or not LeftHandGrip.Parent then
  973.                 LeftHandGrip = CreateRightGrip(LeftHandle)
  974.             end
  975.            
  976.             if AccurateHandPosition then
  977.                 HandPosition = HandPosition * CFrame.new(0, 0, 1)
  978.             end
  979.            
  980.             if not VRReady then
  981.                 HandPosition = VirtualRig.LeftUpperArm.CFrame:Lerp(VirtualRig.LeftLowerArm.CFrame, 0.5) * AccessorySettings.LimbOffset
  982.                 --warn("Setting HandPosition to hands")
  983.                 if Point1 then
  984.                     VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  985.                     VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  986.                 elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  987.                     VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  988.                 end
  989.             end
  990.            
  991.             local Parent = LeftHandGrip.Parent
  992.            
  993.             LeftHandGrip.C1 = CFrame.new()
  994.             LeftHandGrip.C0 = LeftHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)
  995.             LeftHandGrip.Parent = nil
  996.             LeftHandGrip.Parent = Parent
  997.            
  998.         end
  999.     end
  1000.    
  1001.     if RagdollEnabled then
  1002.         if UserCFrame == Enum.UserCFrame.Head and RagdollHeadMovement then
  1003.             MoveHead(Positioning)
  1004.         elseif UserCFrame == Enum.UserCFrame.RightHand then
  1005.             local Positioning = Positioning
  1006.            
  1007.             if not VRReady then
  1008.                 Positioning = VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5)
  1009.             elseif AccurateHandPosition then
  1010.                 Positioning = Positioning * CFrame.new(0, 0, 1)
  1011.             end
  1012.            
  1013.             if VRReady then
  1014.                 Positioning = Positioning * AccessorySettings.LimbOffset
  1015.             end
  1016.            
  1017.             MoveRightArm(Positioning)
  1018.            
  1019.             if Point2 then
  1020.                 VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  1021.                 VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  1022.             elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  1023.                 VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  1024.             end
  1025.         elseif UserCFrame == Enum.UserCFrame.LeftHand then
  1026.             local Positioning = Positioning
  1027.            
  1028.             if not VRReady then
  1029.                 Positioning = VirtualRig.LeftUpperArm.CFrame:Lerp(VirtualRig.LeftLowerArm.CFrame, 0.5)
  1030.             elseif AccurateHandPosition then
  1031.                 Positioning = Positioning * CFrame.new(0, 0, 1)
  1032.             end
  1033.            
  1034.             if VRReady then
  1035.                 Positioning = Positioning * AccessorySettings.LimbOffset
  1036.             end
  1037.            
  1038.             MoveLeftArm(Positioning)
  1039.            
  1040.             if Point1 then
  1041.                 VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  1042.                 VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  1043.             elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  1044.                 VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  1045.             end
  1046.         end
  1047.     end
  1048.    
  1049.     if UserCFrame == Enum.UserCFrame.Head then
  1050.         VirtualRig.Head.CFrame = Positioning
  1051.        
  1052.     elseif UserCFrame == Enum.UserCFrame.RightHand and VRReady then
  1053.         VirtualRig.RightHand.CFrame = Positioning
  1054.        
  1055.     elseif UserCFrame == Enum.UserCFrame.LeftHand and VRReady then
  1056.         VirtualRig.LeftHand.CFrame = Positioning
  1057.        
  1058.     end
  1059.    
  1060.     if not VRReady and VirtualRig.LeftHand.Anchored then
  1061.         VirtualRig.RightHand.Anchored = false
  1062.         VirtualRig.LeftHand.Anchored = false
  1063.     elseif VRReady and not VirtualRig.LeftHand.Anchored then
  1064.         VirtualRig.RightHand.Anchored = true
  1065.         VirtualRig.LeftHand.Anchored = true
  1066.     end
  1067. end
  1068.  
  1069. local CFrameChanged = VRService.UserCFrameChanged:Connect(OnUserCFrameChanged)
  1070.  
  1071. local OnStepped = RunService.Stepped:Connect(function()
  1072.     for _, Part in pairs(VirtualRig:GetChildren()) do
  1073.         if Part:IsA("BasePart") then
  1074.             Part.CanCollide = false
  1075.         end
  1076.     end
  1077.    
  1078.     if RagdollEnabled then
  1079.         for _, Part in pairs(Character:GetChildren()) do
  1080.             if Part:IsA("BasePart") then
  1081.                 Part.CanCollide = false
  1082.             end
  1083.         end
  1084.     end
  1085.    
  1086.     if NoCollision then
  1087.         for _, Player in pairs(Players:GetPlayers()) do
  1088.             if Player ~= Client and Player.Character then
  1089.                 local Descendants = Player.Character:GetDescendants()
  1090.                 for i = 1, #Descendants do
  1091.                     local Part = Descendants[i]
  1092.                     if Part:IsA("BasePart") then
  1093.                         Part.CanCollide = false
  1094.                         Part.Velocity = Vector3.new()
  1095.                         Part.RotVelocity = Vector3.new()
  1096.                     end
  1097.                 end
  1098.             end
  1099.         end
  1100.     end
  1101. end)
  1102.  
  1103. local OnRenderStepped = RunService.Stepped:Connect(function()
  1104.     Camera.CameraSubject = VirtualBody.Humanoid
  1105.    
  1106.     if RagdollEnabled then
  1107.         Character.HumanoidRootPart.CFrame = VirtualRig.UpperTorso.CFrame
  1108.         Character.HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
  1109.     end
  1110.    
  1111.     if not VRReady then
  1112.         OnUserCFrameChanged(Enum.UserCFrame.Head, CFrame.new(0, 0, 0))
  1113.        
  1114.         OnUserCFrameChanged(Enum.UserCFrame.RightHand, CFrame.new(0, 0, 0), true)
  1115.         OnUserCFrameChanged(Enum.UserCFrame.LeftHand, CFrame.new(0, 0, 0), true)
  1116.     end
  1117. end)
  1118.  
  1119. spawn(function()
  1120.     while Character and Character.Parent do
  1121.         FootYield()
  1122.         UpdateFooting()
  1123.     end
  1124. end)
  1125.  
  1126. --[[
  1127.     Non-VR Support + VR Mechanics
  1128. --]]
  1129.  
  1130. local OnInput = UserInputService.InputBegan:Connect(function(Input, Processed)
  1131.     if not Processed then
  1132.         if Input.KeyCode == Enum.KeyCode.LeftControl or Input.KeyCode == Enum.KeyCode.ButtonL2 then
  1133.             Tween(VirtualBody.Humanoid, "Elastic", "Out", 1, {
  1134.                 CameraOffset = Vector3.new(0, StudsOffset - 1.5, 0)
  1135.             })
  1136.         end
  1137.    
  1138.         if Input.KeyCode == Enum.KeyCode.X then
  1139.             if RagdollEnabled and RagdollHeadMovement then
  1140.                 Network:Unclaim()
  1141.                 Respawn()
  1142.             end
  1143.         end
  1144.        
  1145.         if Input.KeyCode == Enum.KeyCode.C then
  1146.             VirtualBody:MoveTo(Mouse.Hit.p)
  1147.             VirtualRig:MoveTo(Mouse.Hit.p)
  1148.         end
  1149.     end
  1150.        
  1151.     if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.ButtonR2 then
  1152.         Tween(VirtualBody.Humanoid, "Sine", "Out", 1, {
  1153.             WalkSpeed = 16
  1154.         })
  1155.     end
  1156.    
  1157.     if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1158.         Point1 = true
  1159.     end
  1160.    
  1161.     if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton2 then
  1162.         Point2 = true
  1163.     end
  1164.    
  1165.     if VRReady and Input.KeyCode == Enum.KeyCode.ButtonY then
  1166.         Character:BreakJoints()
  1167.        
  1168.         if RagdollEnabled and RagdollHeadMovement then
  1169.             Network:Unclaim()
  1170.             Respawn()
  1171.         end
  1172.     end
  1173. end)
  1174.  
  1175. local OnInputEnded = UserInputService.InputEnded:Connect(function(Input, Processed)
  1176.     if not Processed then
  1177.         if Input.KeyCode == Enum.KeyCode.LeftControl or Input.KeyCode == Enum.KeyCode.ButtonL2 then
  1178.             Tween(VirtualBody.Humanoid, "Elastic", "Out", 1, {
  1179.                 CameraOffset = Vector3.new(0, StudsOffset, 0)
  1180.             })
  1181.         end
  1182.     end
  1183.        
  1184.     if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.ButtonR2 then
  1185.         Tween(VirtualBody.Humanoid, "Sine", "Out", 1, {
  1186.             WalkSpeed = 8
  1187.         })
  1188.     end
  1189.    
  1190.     if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1191.         Point1 = false
  1192.     end
  1193.    
  1194.     if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton2 then
  1195.         Point2 = false
  1196.     end
  1197. end)
  1198.  
  1199. --[[
  1200.     Proper Cleanup
  1201. --]]
  1202.  
  1203. local OnReset
  1204.  
  1205. OnReset = Client.CharacterAdded:Connect(function()
  1206.     OnReset:Disconnect();
  1207.     CFrameChanged:Disconnect();
  1208.     OnStepped:Disconnect();
  1209.     OnRenderStepped:Disconnect();
  1210.     OnMoving:Disconnect();
  1211.     OnInput:Disconnect();
  1212.     OnInputEnded:Disconnect();
  1213.    
  1214.     VirtualRig:Destroy();
  1215.     VirtualBody:Destroy();
  1216.    
  1217.     if RagdollEnabled then
  1218.         Network:Unclaim();
  1219.     end
  1220.    
  1221.     if AutoRun then
  1222.         delay(2, function()
  1223.             Script()
  1224.         end)
  1225.     end
  1226. end)
  1227.  
  1228. if ChatEnabled then
  1229.     spawn(ChatHUDFunc)
  1230. end
  1231.  
  1232. if ViewportEnabled then
  1233.     spawn(ViewHUDFunc)
  1234. end
  1235.  
  1236. do
  1237.     --[[
  1238.         Functions
  1239.     --]]
  1240.    
  1241.     local Players = game:GetService("Players")
  1242.      local Client = Players.LocalPlayer
  1243.    
  1244.     local VRService = game:GetService("VRService")
  1245.      local VRReady = VRService.VREnabled
  1246.    
  1247.     local UserInputService = game:GetService("UserInputService")
  1248.     local RunService = game:GetService("RunService")
  1249.    
  1250.     local Camera = workspace.CurrentCamera
  1251.    
  1252.     --[[
  1253.         Code
  1254.     --]]
  1255.    
  1256.     if VRReady then
  1257.         local Pointer = game:GetObjects("rbxassetid://4649971235")[1]
  1258.        
  1259.         Pointer.Parent = workspace
  1260.         Pointer.Beam.Enabled = false
  1261.         Pointer.Target.ParticleEmitter.Enabled = false
  1262.        
  1263.         local RenderStepped = RunService.RenderStepped:Connect(function()
  1264.             if Pointer.Beam.Enabled then
  1265.                 local RightHand = Camera.CFrame * VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
  1266.                 local Target = RightHand * CFrame.new(0, 0, -10)
  1267.                
  1268.                 local Line = Ray.new(RightHand.p, (Target.p - RightHand.p).Unit * 128)
  1269.                 local Part, Position = workspace:FindPartOnRayWithIgnoreList(Line, {VirtualRig, VirtualBody, Character, Pointer})
  1270.                
  1271.                 local Distance = (Position - RightHand.p).Magnitude
  1272.                
  1273.                 Pointer.Target.Position = Vector3.new(0, 0, -Distance)
  1274.                 Pointer.CFrame = RightHand
  1275.             end
  1276.         end)
  1277.        
  1278.         local Input = UserInputService.InputBegan:Connect(function(Input)
  1279.             if Input.KeyCode == Enum.KeyCode.ButtonB then
  1280.                 Pointer.Beam.Enabled = not Pointer.Beam.Enabled
  1281.                 Pointer.Target.ParticleEmitter.Enabled = not Pointer.Target.ParticleEmitter.Enabled
  1282.             end
  1283.         end)
  1284.        
  1285.         --
  1286.        
  1287.         local CharacterAdded
  1288.        
  1289.         CharacterAdded = Client.CharacterAdded:Connect(function()
  1290.             RenderStepped:Disconnect()
  1291.             Input:Disconnect()
  1292.             CharacterAdded:Disconnect()
  1293.            
  1294.             Pointer:Destroy()
  1295.             Pointer = nil
  1296.         end)
  1297.     else
  1298.         return
  1299.     end
  1300. end
  1301.  
  1302. end;
  1303.  
  1304. Permadeath = function()
  1305.     local ch = game.Players.LocalPlayer.Character
  1306.     local prt=Instance.new("Model", workspace)
  1307.     local z1 =  Instance.new("Part", prt)
  1308.     z1.Name="Torso"
  1309.     z1.CanCollide = false
  1310.     z1.Anchored = true
  1311.     local z2  =Instance.new("Part", prt)
  1312.     z2.Name="Head"
  1313.     z2.Anchored = true
  1314.     z2.CanCollide = false
  1315.     local z3 =Instance.new("Humanoid", prt)
  1316.     z3.Name="Humanoid"
  1317.     z1.Position = Vector3.new(0,9999,0)
  1318.     z2.Position = Vector3.new(0,9991,0)
  1319.     game.Players.LocalPlayer.Character=prt
  1320.     wait(5)
  1321.     warn("50%")
  1322.     game.Players.LocalPlayer.Character=ch
  1323.     wait(6)
  1324.     warn("100%")
  1325. end;
  1326.  
  1327. Respawn = function()
  1328.     local ch = game.Players.LocalPlayer.Character
  1329.    
  1330.     local prt=Instance.new("Model", workspace)
  1331.     local z1 =  Instance.new("Part", prt)
  1332.     z1.Name="Torso"
  1333.     z1.CanCollide = false
  1334.     z1.Anchored = true
  1335.     local z2  =Instance.new("Part", prt)
  1336.     z2.Name="Head"
  1337.     z2.Anchored = true
  1338.     z2.CanCollide = false
  1339.     local z3 =Instance.new("Humanoid", prt)
  1340.     z3.Name="Humanoid"
  1341.     z1.Position = Vector3.new(0,9999,0)
  1342.     z2.Position = Vector3.new(0,9991,0)
  1343.     game.Players.LocalPlayer.Character=prt
  1344.     wait(5)
  1345.     game.Players.LocalPlayer.Character=ch
  1346. end;
  1347.  
  1348. ChatHUDFunc = function()
  1349.     --[[
  1350.         Variables
  1351.     --]]
  1352.    
  1353.     local UserInputService = game:GetService("UserInputService")
  1354.     local RunService = game:GetService("RunService")
  1355.    
  1356.     local VRService = game:GetService("VRService")
  1357.      local VRReady = VRService.VREnabled
  1358.    
  1359.     local Players = game:GetService("Players")
  1360.      local Client = Players.LocalPlayer
  1361.    
  1362.     local ChatHUD = game:GetObjects("rbxassetid://4649972829")[1]
  1363.      local GlobalFrame = ChatHUD.GlobalFrame
  1364.       local Template = GlobalFrame.Template
  1365.      local LocalFrame = ChatHUD.LocalFrame
  1366.      local Global = ChatHUD.Global
  1367.      local Local = ChatHUD.Local
  1368.    
  1369.     local Camera = workspace.CurrentCamera
  1370.    
  1371.     Template.Parent = nil
  1372.     ChatHUD.Parent = game:GetService("CoreGui")
  1373.    
  1374.     --[[
  1375.         Code
  1376.     --]]
  1377.    
  1378.     local Highlight = Global.Frame.BackgroundColor3
  1379.     local Deselected = Local.Frame.BackgroundColor3
  1380.    
  1381.     local OpenGlobalTab = function()
  1382.         Global.Frame.BackgroundColor3 = Highlight
  1383.         Local.Frame.BackgroundColor3 = Deselected
  1384.        
  1385.         Global.Font = Enum.Font.SourceSansBold
  1386.         Local.Font = Enum.Font.SourceSans
  1387.        
  1388.         GlobalFrame.Visible = true
  1389.         LocalFrame.Visible = false
  1390.     end
  1391.    
  1392.     local OpenLocalTab = function()
  1393.         Global.Frame.BackgroundColor3 = Deselected
  1394.         Local.Frame.BackgroundColor3 = Highlight
  1395.        
  1396.         Global.Font = Enum.Font.SourceSans
  1397.         Local.Font = Enum.Font.SourceSansBold
  1398.        
  1399.         GlobalFrame.Visible = false
  1400.         LocalFrame.Visible = true
  1401.     end
  1402.    
  1403.     Global.MouseButton1Down:Connect(OpenGlobalTab)
  1404.     Local.MouseButton1Down:Connect(OpenLocalTab)
  1405.     Global.MouseButton1Click:Connect(OpenGlobalTab)
  1406.     Local.MouseButton1Click:Connect(OpenLocalTab)
  1407.    
  1408.     OpenLocalTab()
  1409.    
  1410.     --
  1411.    
  1412.     local function GetPlayerDistance(Sender)
  1413.         if Sender.Character and Sender.Character:FindFirstChild("Head") then
  1414.             return math.floor((Sender.Character.Head.Position - Camera:GetRenderCFrame().p).Magnitude + 0.5)
  1415.         end
  1416.     end
  1417.    
  1418.     local function NewGlobal(Message, Sender, Color)
  1419.         local Frame = Template:Clone()
  1420.        
  1421.         Frame.Text = ("[%s]: %s"):format(Sender.Name, Message)
  1422.         Frame.User.Text = ("[%s]:"):format(Sender.Name)
  1423.         Frame.User.TextColor3 = Color
  1424.         Frame.BackgroundColor3 = Color
  1425.         Frame.Parent = GlobalFrame
  1426.        
  1427.         delay(60, function()
  1428.             Frame:Destroy()
  1429.         end)
  1430.     end
  1431.    
  1432.     local function NewLocal(Message, Sender, Color, Dist)
  1433.         local Frame = Template:Clone()
  1434.        
  1435.         Frame.Text = ("(%s) [%s]: %s"):format(tostring(Dist), Sender.Name, Message)
  1436.         Frame.User.Text = ("(%s) [%s]:"):format(tostring(Dist), Sender.Name)
  1437.         Frame.User.TextColor3 = Color
  1438.         Frame.BackgroundColor3 = Color
  1439.         Frame.Parent = LocalFrame
  1440.        
  1441.         delay(60, function()
  1442.             Frame:Destroy()
  1443.         end)
  1444.     end
  1445.    
  1446.     local function OnNewChat(Message, Sender, Color)
  1447.         if not ChatHUD or not ChatHUD.Parent then return end
  1448.        
  1449.         NewGlobal(Message, Sender, Color)
  1450.        
  1451.         local Distance = GetPlayerDistance(Sender)
  1452.        
  1453.         if Distance and Distance <= ChatLocalRange then
  1454.             NewLocal(Message, Sender, Color, Distance)
  1455.         end
  1456.     end
  1457.    
  1458.     local function OnPlayerAdded(Player)
  1459.         if not ChatHUD or not ChatHUD.Parent then return end
  1460.        
  1461.         local Color = BrickColor.Random().Color
  1462.        
  1463.         Player.Chatted:Connect(function(Message)
  1464.             OnNewChat(Message, Player, Color)
  1465.         end)
  1466.     end
  1467.    
  1468.     Players.PlayerAdded:Connect(OnPlayerAdded)
  1469.    
  1470.     for _, Player in pairs(Players:GetPlayers()) do
  1471.         OnPlayerAdded(Player)
  1472.     end
  1473.    
  1474.     --
  1475.    
  1476.     local ChatPart = ChatHUD.Part
  1477.    
  1478.     ChatHUD.Adornee = ChatPart
  1479.    
  1480.     if VRReady then
  1481.         ChatHUD.Parent = game:GetService("CoreGui")
  1482.         ChatHUD.Enabled = true
  1483.         ChatHUD.AlwaysOnTop = true
  1484.        
  1485.         local OnInput = UserInputService.InputBegan:Connect(function(Input, Processed)
  1486.             if not Processed then
  1487.                 if Input.KeyCode == Enum.KeyCode.ButtonX then
  1488.                     ChatHUD.Enabled = not ChatHUD.Enabled
  1489.                 end
  1490.             end
  1491.         end)
  1492.        
  1493.         local RenderStepped = RunService.RenderStepped:Connect(function()
  1494.             local LeftHand = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
  1495.            
  1496.             ChatPart.CFrame = Camera.CFrame * LeftHand
  1497.         end)
  1498.        
  1499.         local CharacterAdded
  1500.        
  1501.         CharacterAdded = Client.CharacterAdded:Connect(function()
  1502.             OnInput:Disconnect()
  1503.             RenderStepped:Disconnect()
  1504.             CharacterAdded:Disconnect()
  1505.            
  1506.             ChatHUD:Destroy()
  1507.             ChatHUD = nil
  1508.         end)
  1509.     end
  1510.    
  1511.     wait(9e9)
  1512. end;
  1513.  
  1514. ViewHUDFunc = function()
  1515.     --[[
  1516.         Variables
  1517.     --]]
  1518.    
  1519.     local ViewportRange = ViewportRange or 32
  1520.    
  1521.     local UserInputService = game:GetService("UserInputService")
  1522.     local RunService = game:GetService("RunService")
  1523.    
  1524.     local VRService = game:GetService("VRService")
  1525.      local VRReady = VRService.VREnabled
  1526.    
  1527.     local Players = game:GetService("Players")
  1528.      local Client = Players.LocalPlayer
  1529.       local Mouse = Client:GetMouse()
  1530.    
  1531.     local Camera = workspace.CurrentCamera
  1532.      local CameraPort = Camera.CFrame
  1533.    
  1534.     local ViewHUD = script:FindFirstChild("ViewHUD") or game:GetObjects("rbxassetid://4649974000")[1]
  1535.      local Viewport = ViewHUD.Viewport
  1536.       local Viewcam = Instance.new("Camera")
  1537.      local ViewPart = ViewHUD.Part
  1538.    
  1539.     ViewHUD.Parent = game:GetService("CoreGui")
  1540.    
  1541.     Viewcam.Parent = Viewport
  1542.     Viewcam.CameraType = Enum.CameraType.Scriptable
  1543.     Viewport.CurrentCamera = Viewcam
  1544.     Viewport.BackgroundTransparency = 1
  1545.    
  1546.     --[[
  1547.         Code
  1548.     --]]
  1549.    
  1550.     local function Clone(Character)
  1551.         local Arc = Character.Archivable
  1552.         local Clone;
  1553.        
  1554.         Character.Archivable = true
  1555.         Clone = Character:Clone()
  1556.         Character.Archivable = Arc
  1557.        
  1558.         return Clone
  1559.     end
  1560.    
  1561.     local function GetPart(Name, Parent, Descendants)
  1562.         for i = 1, #Descendants do
  1563.             local Part = Descendants[i]
  1564.            
  1565.             if Part.Name == Name and Part.Parent.Name == Parent then
  1566.                 return Part
  1567.             end
  1568.         end
  1569.     end
  1570.    
  1571.     local function OnPlayerAdded(Player)
  1572.         if not ViewHUD or not ViewHUD.Parent then return end
  1573.        
  1574.         local function CharacterAdded(Character)
  1575.             if not ViewHUD or not ViewHUD.Parent then return end
  1576.            
  1577.             Character:WaitForChild("Head")
  1578.             Character:WaitForChild("Humanoid")
  1579.            
  1580.             wait(3)
  1581.            
  1582.             local FakeChar = Clone(Character)
  1583.             local Root = FakeChar:FindFirstChild("HumanoidRootPart") or FakeChar:FindFirstChild("Head")
  1584.             local RenderConnection;
  1585.            
  1586.             local Descendants = FakeChar:GetDescendants()
  1587.             local RealDescendants = Character:GetDescendants()
  1588.             local Correspondents = {};
  1589.            
  1590.             FakeChar.Humanoid.DisplayDistanceType = "None"
  1591.            
  1592.             for i = 1, #Descendants do
  1593.                 local Part = Descendants[i]
  1594.                 local Real = Part:IsA("BasePart") and GetPart(Part.Name, Part.Parent.Name, RealDescendants)
  1595.                
  1596.                 if Part:IsA("BasePart") and Real then
  1597.                     Part.Anchored = true
  1598.                     Part:BreakJoints()
  1599.                    
  1600.                     if Part.Parent:IsA("Accessory") then
  1601.                         Part.Transparency = 0
  1602.                     end
  1603.                    
  1604.                     table.insert(Correspondents, {Part, Real})
  1605.                 end
  1606.             end
  1607.            
  1608.             RenderConnection = RunService.RenderStepped:Connect(function()
  1609.                 if not Character or not Character.Parent then
  1610.                     RenderConnection:Disconnect()
  1611.                     FakeChar:Destroy()
  1612.                    
  1613.                     return
  1614.                 end
  1615.                
  1616.                 if (Root and (Root.Position - Camera.CFrame.p).Magnitude <= ViewportRange) or Player == Client or not Root then
  1617.                     for i = 1, #Correspondents do
  1618.                         local Part, Real = unpack(Correspondents[i])
  1619.                        
  1620.                         if Part and Real and Part.Parent and Real.Parent then
  1621.                             Part.CFrame = Real.CFrame
  1622.                         elseif Part.Parent and not Real.Parent then
  1623.                             Part:Destroy()
  1624.                         end
  1625.                     end
  1626.                 end
  1627.             end)
  1628.            
  1629.             FakeChar.Parent = Viewcam
  1630.         end
  1631.        
  1632.         Player.CharacterAdded:Connect(CharacterAdded)
  1633.        
  1634.         if Player.Character then
  1635.             spawn(function()
  1636.                 CharacterAdded(Player.Character)
  1637.             end)
  1638.         end
  1639.     end
  1640.    
  1641.     local PlayerAdded = Players.PlayerAdded:Connect(OnPlayerAdded)
  1642.    
  1643.     for _, Player in pairs(Players:GetPlayers()) do
  1644.         OnPlayerAdded(Player)
  1645.     end
  1646.    
  1647.     ViewPart.Size = Vector3.new()
  1648.    
  1649.     if VRReady then
  1650.         Viewport.Position = UDim2.new(.62, 0, .89, 0)
  1651.         Viewport.Size = UDim2.new(.3, 0, .3, 0)
  1652.         Viewport.AnchorPoint = Vector2.new(.5, 1)
  1653.     else
  1654.         Viewport.Size = UDim2.new(0.3, 0, 0.3, 0)
  1655.     end
  1656.    
  1657.     local RenderStepped = RunService.RenderStepped:Connect(function()
  1658.         local Render = Camera.CFrame
  1659.         local Scale = Camera.ViewportSize
  1660.        
  1661.         if VRReady then
  1662.             Render = Render * VRService:GetUserCFrame(Enum.UserCFrame.Head)
  1663.         end
  1664.        
  1665.         CameraPort = CFrame.new(Render.p + Vector3.new(5, 2, 0), Render.p)
  1666.        
  1667.         Viewport.Camera.CFrame = CameraPort
  1668.        
  1669.         ViewPart.CFrame = Render * CFrame.new(0, 0, -16)
  1670.        
  1671.         ViewHUD.Size = UDim2.new(0, Scale.X - 6, 0, Scale.Y - 6)
  1672.     end)
  1673.        
  1674.     --
  1675.    
  1676.     local CharacterAdded
  1677.    
  1678.     CharacterAdded = Client.CharacterAdded:Connect(function()
  1679.         RenderStepped:Disconnect()
  1680.         CharacterAdded:Disconnect()
  1681.         PlayerAdded:Disconnect()
  1682.        
  1683.         ViewHUD:Destroy()
  1684.         ViewHUD = nil
  1685.     end)
  1686.    
  1687.     wait(9e9)
  1688. end;
  1689.  
  1690. Script()
  1691.  
  1692. wait(9e9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement