The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Vr script pastebin roblox
By Vr on 2024-09-22 08:00 am | Syntax: LUA | Views: 8



New Script | Raw | Show/Hide line no. | Copy text to clipboard
  1.  
  2.  
  3.  
  4.  
  5. local StudsOffset = 0.1 -- Character height (negative if you're too high)
  6. local Smoothness = 1 -- Character interpolation (0.1 - 1 = smooth - rigid)
  7.  
  8. local AnchorCharacter = false -- Prevent physics from causing inconsistencies
  9. local HideCharacter = false -- Hide character on a platform
  10. local NoCollision = false -- Disable player collision
  11.  
  12. local ChatEnabled = true -- See chat on your left hand in-game
  13.  local ChatLocalRange = 75 -- Local chat range
  14.  
  15. local ViewportEnabled = true -- View nearby players in a frame
  16.  local ViewportRange = 100 -- Maximum distance players are updated
  17.  
  18. local RagdollEnabled = true -- Use your character instead of hats (NetworkOwner vulnerability)
  19.  local RagdollHeadMovement = true -- Move your head separately from your body (+9 second wait)
  20.  
  21. local AutoRun = false -- Run script on respawn
  22. local AutoRespawn = true -- Kill your real body when your virtual body dies
  23.  
  24. local WearAllAccessories = true -- Use all leftover hats for the head
  25. local AccurateHandPosition = true -- Move your Roblox hands according to your real hands
  26.  
  27. local AccessorySettings = {
  28.  LeftArm  = "";
  29.  RightArm = "";
  30.  LeftLeg  = "";
  31.  RightLeg = "";
  32.  Torso  = "";
  33.  Head  = true;
  34.  
  35.  BlockArms = true;
  36.  BlockLegs = true;
  37.  BlockTorso = true;
  38.  
  39.  LimbOffset = CFrame.Angles(math.rad(90), 0, 0);
  40. }
  41.  
  42. local FootPlacementSettings = {
  43.  RightOffset = Vector3.new(.5, 0, 0),
  44.  LeftOffset = Vector3.new(-.5, 0, 0),
  45. }
  46.  
  47. --|| Script:
  48.  
  49. local Script = nil;
  50.  
  51. Script = function()
  52.  
  53. --[[
  54.  Variables
  55. --]]
  56.  
  57. local Players = game:GetService("Players")
  58.  local Client = Players.LocalPlayer
  59.   local Character = Client.Character or Client.CharacterAdded:Wait()
  60.    local WeldBase = Character:WaitForChild("HumanoidRootPart")
  61.    local ArmBase = Character:FindFirstChild("RightHand") or Character:FindFirstChild("Right Arm") or WeldBase
  62.   local Backpack = Client:WaitForChild("Backpack")
  63.   local Mouse = Client:GetMouse()
  64.  
  65. local Camera = workspace.CurrentCamera
  66.  
  67. local VRService = game:GetService("VRService")
  68.  local VRReady = VRService.VREnabled
  69.  
  70. local UserInputService = game:GetService("UserInputService")
  71. local RunService = game:GetService("RunService")
  72. local HttpService = game:GetService("HttpService")
  73. local StarterGui = game:GetService("StarterGui")
  74.  
  75. local HeadAccessories = {};
  76. local UsedAccessories = {};
  77.  
  78. local Pointer = false;
  79. local Point1 = false;
  80. local Point2 = false;
  81.  
  82. local VirtualRig = game:GetObjects("rbxassetid://4468539481")[1]
  83. local VirtualBody = game:GetObjects("rbxassetid://4464983829")[1]
  84.  
  85. local Anchor = Instance.new("Part")
  86.  
  87. Anchor.Anchored = true
  88. Anchor.Transparency = 1
  89. Anchor.CanCollide = false
  90. Anchor.Parent = workspace
  91.  
  92. if RagdollEnabled then
  93.  print("RagdollEnabled, thank you for using CLOVR!")
  94.  local NetworkAccess = coroutine.create(function()
  95. settings().Physics.AllowSleep = false
  96. while true do game:GetService("RunService").RenderStepped:Wait()
  97. for _,Players in next, game:GetService("Players"):GetChildren() do
  98. if Players ~= game:GetService("Players").LocalPlayer then
  99. Players.MaximumSimulationRadius = 0.1 Players.SimulationRadius = 0 end end
  100. game:GetService("Players").LocalPlayer.MaximumSimulationRadius = math.pow(math.huge,math.huge)
  101. game:GetService("Players").LocalPlayer.SimulationRadius = math.huge*math.huge end end)
  102. coroutine.resume(NetworkAccess)
  103. end
  104.  
  105.  
  106.  
  107. --[[
  108.  Character Protection
  109. --]]
  110.  
  111. local CharacterCFrame = WeldBase.CFrame
  112.  
  113. if not RagdollEnabled then
  114.  Character.Humanoid.AnimationPlayed:Connect(function(Animation)
  115.   Animation:Stop()
  116.  end)
  117.  
  118.  for _, Track in next, Character.Humanoid:GetPlayingAnimationTracks() do
  119.   Track:Stop()
  120.  end
  121.  
  122.  if HideCharacter then
  123.   local Platform = Instance.new("Part")
  124.  
  125.   Platform.Anchored = true
  126.   Platform.Size = Vector3.new(100, 5, 100)
  127.   Platform.CFrame = CFrame.new(0, 10000, 0)
  128.   Platform.Transparency = 1
  129.   Platform.Parent = workspace
  130.  
  131.   Character:MoveTo(Platform.Position + Vector3.new(0, 5, 0))
  132.  
  133.   wait(.5)
  134.  end
  135.  
  136.  if AnchorCharacter then
  137.   for _, Part in pairs(Character:GetChildren()) do
  138.    if Part:IsA("BasePart") then
  139.     Part.Anchored = true
  140.    end
  141.   end
  142.  end
  143. end
  144.  
  145. --[[
  146.  Functions
  147. --]]
  148.  
  149. function Tween(Object, Style, Direction, Time, Goal)
  150.     local tweenInfo = TweenInfo.new(Time, Enum.EasingStyle[Style], Enum.EasingDirection[Direction])
  151.     local tween = game:GetService("TweenService"):Create(Object, tweenInfo, Goal)
  152.  
  153.  tween.Completed:Connect(function()
  154.   tween:Destroy()
  155.  end)
  156.  
  157.     tween:Play()
  158.  
  159.     return tween
  160. end
  161.  
  162. local function GetMotorForLimb(Limb)
  163.  for _, Motor in next, Character:GetDescendants() do
  164.   if Motor:IsA("Motor6D") and Motor.Part1 == Limb then
  165.    return Motor
  166.   end
  167.  end
  168. end
  169.  
  170. local function CreateAlignment(Limb, Part0)
  171.  local Attachment0 = Instance.new("Attachment", Part0 or Anchor)
  172.  local Attachment1 = Instance.new("Attachment", Limb)
  173.  
  174.  local Orientation = Instance.new("AlignOrientation")
  175.  local Position = Instance.new("AlignPosition")
  176.  
  177.  Orientation.Attachment0 = Attachment1
  178.  Orientation.Attachment1 = Attachment0
  179.  Orientation.RigidityEnabled = false
  180.  Orientation.MaxTorque = 20000
  181.  Orientation.Responsiveness = 40
  182.  Orientation.Parent = Character.HumanoidRootPart
  183.  
  184.  Position.Attachment0 = Attachment1
  185.  Position.Attachment1 = Attachment0
  186.  Position.RigidityEnabled = false
  187.  Position.MaxForce = 40000
  188.  Position.Responsiveness = 40
  189.  Position.Parent = Character.HumanoidRootPart
  190.  
  191.  Limb.Massless = false
  192.  
  193.  local Motor = GetMotorForLimb(Limb)
  194.  if Motor then
  195.   Motor:Destroy()
  196.  end
  197.  
  198.  return function(CF, Local)
  199.   if Local then
  200.    Attachment0.CFrame = CF
  201.   else
  202.    Attachment0.WorldCFrame = CF
  203.   end
  204.  end;
  205. end
  206.  
  207. local function GetExtraTool()
  208.  for _, Tool in next, Character:GetChildren() do
  209.   if Tool:IsA("Tool") and not Tool.Name:match("LIMB_TOOL") then
  210.    return Tool
  211.   end
  212.  end
  213. end
  214.  
  215. local function GetGripForHandle(Handle)
  216.  for _, Weld in next, Character:GetDescendants() do
  217.   if Weld:IsA("Weld") and (Weld.Part0 == Handle or Weld.Part1 == Handle) then
  218.    return Weld
  219.   end
  220.  end
  221.  
  222.  wait(.2)
  223.  
  224.  for _, Weld in next, Character:GetDescendants() do
  225.   if Weld:IsA("Weld") and (Weld.Part0 == Handle or Weld.Part1 == Handle) then
  226.    return Weld
  227.   end
  228.  end
  229. end
  230.  
  231. local function CreateRightGrip(Handle)
  232.  local RightGrip = Instance.new("Weld")
  233.  
  234.  RightGrip.Name = "RightGrip"
  235.  RightGrip.Part1 = Handle
  236.  RightGrip.Part0 = WeldBase
  237.  RightGrip.Parent = WeldBase
  238.  
  239.  return RightGrip
  240. end
  241.  
  242. local function CreateAccessory(Accessory, DeleteMeshes)
  243.  if not Accessory then
  244.   return
  245.  end
  246.  
  247.  local HatAttachment = Accessory.Handle:FindFirstChildWhichIsA("Attachment")
  248.  local HeadAttachment = VirtualRig:FindFirstChild(HatAttachment.Name, true)
  249.  local BasePart = HeadAttachment.Parent
  250.  
  251.  local HatAtt = HatAttachment.CFrame
  252.  local HeadAtt = HeadAttachment.CFrame
  253.  
  254.  if DeleteMeshes then
  255.   if Accessory.Handle:FindFirstChild("Mesh") then
  256.    Accessory.Handle.Mesh:Destroy()
  257.   end
  258.  end
  259.  
  260.  wait()
  261.  
  262.  local Handle = Accessory:WaitForChild("Handle")
  263.  
  264.  if Handle:FindFirstChildWhichIsA("Weld", true) then
  265.   Handle:FindFirstChildWhichIsA("Weld", true):Destroy()
  266.   Handle:BreakJoints()
  267.  else
  268.   Handle:BreakJoints()
  269.  end
  270.  
  271.  Handle.Massless = true
  272.  Handle.Transparency = 0.5
  273.  
  274.  UsedAccessories[Accessory] = true
  275.  
  276.  local RightGrip = CreateRightGrip(Handle)
  277.  
  278.  wait()
  279.  
  280.  for _, Object in pairs(Handle:GetDescendants()) do
  281.   if not Object:IsA("BasePart") then
  282.    pcall(function()
  283.     Object.Transparency = 1
  284.    end)
  285.    
  286.    pcall(function()
  287.     Object.Enabled = false
  288.    end)
  289.   end
  290.  end
  291.  
  292.  return Handle, RightGrip, HatAtt, HeadAtt, BasePart;
  293. end
  294.  
  295. local function GetHeadAccessories()
  296.  for _, Accessory in next, Character:GetChildren() do
  297.   if Accessory:IsA("Accessory") and not UsedAccessories[Accessory] then
  298.    local Handle, RightGrip, HatAtt, HeadAtt, BasePart = CreateAccessory(Accessory)
  299.    
  300.    table.insert(HeadAccessories, {Handle, RightGrip, HatAtt, HeadAtt, BasePart})
  301.    
  302.    do
  303.     Handle.Transparency = 1
  304.    end
  305.    
  306.    if not WearAllAccessories then
  307.     break
  308.    end
  309.   end
  310.  end
  311. end
  312.  
  313. --[[
  314.  VR Replication Setup
  315. --]]
  316.  
  317. if not RagdollEnabled then
  318.  LeftHandle, LeftHandGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.LeftArm), AccessorySettings.BlockArms)
  319.  RightHandle, RightHandGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.RightArm), AccessorySettings.BlockArms)
  320.  LeftHipHandle, LeftLegGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.LeftLeg), AccessorySettings.BlockLegs)
  321.  RightHipHandle, RightLegGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.RightLeg), AccessorySettings.BlockLegs)
  322.  TorsoHandle, TorsoGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.Torso), AccessorySettings.BlockTorso)
  323.  GetHeadAccessories()
  324.  
  325. elseif RagdollEnabled then
  326.  if RagdollHeadMovement then
  327.   Permadeath()
  328.   MoveHead = CreateAlignment(Character["Head"])
  329.  end
  330.  
  331.  MoveRightArm = CreateAlignment(Character["Right Arm"])
  332.  MoveLeftArm = CreateAlignment(Character["Left Arm"])
  333.  MoveRightLeg = CreateAlignment(Character["Right Leg"])
  334.  MoveLeftLeg = CreateAlignment(Character["Left Leg"])
  335.  MoveTorso = CreateAlignment(Character["Torso"])
  336.  MoveRoot = CreateAlignment(Character.HumanoidRootPart)
  337.  
  338.  if RagdollHeadMovement then
  339.   for _, Accessory in next, Character:GetChildren() do
  340.    if Accessory:IsA("Accessory") and Accessory:FindFirstChild("Handle") then
  341.     local Attachment1 = Accessory.Handle:FindFirstChildWhichIsA("Attachment")
  342.     local Attachment0 = Character:FindFirstChild(tostring(Attachment1), true)
  343.    
  344.     local Orientation = Instance.new("AlignOrientation")
  345.     local Position = Instance.new("AlignPosition")
  346.    
  347.     print(Attachment1, Attachment0, Accessory)
  348.    
  349.     Orientation.Attachment0 = Attachment1
  350.     Orientation.Attachment1 = Attachment0
  351.     Orientation.RigidityEnabled = false
  352.     Orientation.ReactionTorqueEnabled = true
  353.     Orientation.MaxTorque = 20000
  354.     Orientation.Responsiveness = 40
  355.     Orientation.Parent = Character.Head
  356.    
  357.     Position.Attachment0 = Attachment1
  358.     Position.Attachment1 = Attachment0
  359.     Position.RigidityEnabled = false
  360.     Position.ReactionForceEnabled = true
  361.     Position.MaxForce = 40000
  362.     Position.Responsiveness = 40
  363.     Position.Parent = Character.Head
  364.    end
  365.   end
  366.  end
  367. end
  368.  
  369. --[[
  370.  Movement
  371. --]]
  372.  
  373. VirtualRig.Name = "VirtualRig"
  374. VirtualRig.RightFoot.BodyPosition.Position = CharacterCFrame.p
  375. VirtualRig.LeftFoot.BodyPosition.Position = CharacterCFrame.p
  376. VirtualRig.Parent = workspace
  377. VirtualRig:SetPrimaryPartCFrame(CharacterCFrame)
  378.  
  379. VirtualRig.Humanoid.Health = 0
  380. VirtualRig:BreakJoints()
  381. --
  382.  
  383. VirtualBody.Parent = workspace
  384. VirtualBody.Name = "VirtualBody"
  385. VirtualBody.Humanoid.WalkSpeed = 8
  386. VirtualBody.Humanoid.CameraOffset = Vector3.new(0, StudsOffset, 0)
  387. VirtualBody:SetPrimaryPartCFrame(CharacterCFrame)
  388.  
  389. VirtualBody.Humanoid.Died:Connect(function()
  390.  print("Virtual death")
  391.  if AutoRespawn then
  392.   Character:BreakJoints()
  393.  
  394.   if RagdollHeadMovement and RagdollEnabled then
  395.    Network:Unclaim()
  396.    Respawn()
  397.   end
  398.  end
  399. end)
  400. --
  401.  
  402. Camera.CameraSubject = VirtualBody.Humanoid
  403.  
  404. Character.Humanoid.WalkSpeed = 0
  405. Character.Humanoid.JumpPower = 1
  406.  
  407. for _, Part in next, VirtualBody:GetChildren() do
  408.  if Part:IsA("BasePart") then
  409.   Part.Transparency = 1
  410.  end
  411. end
  412.  
  413. for _, Part in next, VirtualRig:GetChildren() do
  414.  if Part:IsA("BasePart") then
  415.   Part.Transparency = 1
  416.  end
  417. end
  418.  
  419. if not VRReady then
  420.  VirtualRig.RightUpperArm.ShoulderConstraint.RigidityEnabled = true
  421.  VirtualRig.LeftUpperArm.ShoulderConstraint.RigidityEnabled = true
  422. end
  423.  
  424.  
  425. local OnMoving = RunService.Stepped:Connect(function()
  426.  local Direction = Character.Humanoid.MoveDirection
  427.  local Start = VirtualBody.HumanoidRootPart.Position
  428.  local Point = Start + Direction * 6
  429.  
  430.  VirtualBody.Humanoid:MoveTo(Point)
  431. end)
  432.  
  433. Character.Humanoid.Jumping:Connect(function()
  434.  VirtualBody.Humanoid.Jump = true
  435. end)
  436.  
  437. UserInputService.JumpRequest:Connect(function()
  438.  VirtualBody.Humanoid.Jump = true
  439. end)
  440.  
  441. --[[
  442.  VR Replication
  443. --]]
  444.  
  445. if RagdollEnabled then
  446.  for _, Part in pairs(Character:GetDescendants()) do
  447.   if Part:IsA("BasePart") and Part.Name == "Handle" and Part.Parent:IsA("Accessory") then
  448.    Part.LocalTransparencyModifier = 1
  449.   elseif Part:IsA("BasePart") and Part.Transparency < 0 xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed> 0 then
  450.   MaxDist = .5
  451.  else
  452.   MaxDist = 1
  453.  end
  454.  
  455.  local PastThreshold = (Foot.Position - Target.Position).Magnitude > MaxDist
  456.  local PastTick = tick() - FootUpdateDebounce >= 2
  457.  
  458.  if PastThreshold or PastTick then
  459.   FootUpdateDebounce = tick()
  460.  end
  461.  
  462.  return
  463.   PastThreshold
  464.  or
  465.   PastTick
  466. end
  467.  
  468. local function FootYield()
  469.  local RightFooting = VirtualRig.RightFoot.BodyPosition
  470.  local LeftFooting = VirtualRig.LeftFoot.BodyPosition
  471.  local LowerTorso = VirtualRig.LowerTorso
  472.  
  473.  local Yield = tick()
  474.  
  475.  repeat
  476.   RunService.Stepped:Wait()
  477.   if
  478.    (LowerTorso.Position - RightFooting.Position).Y > 4
  479.   or
  480.    (LowerTorso.Position - LeftFooting.Position).Y > 4
  481.   or
  482.    ((LowerTorso.Position - RightFooting.Position) * Vector3.new(1, 0, 1)).Magnitude > 4
  483.   or
  484.    ((LowerTorso.Position - LeftFooting.Position) * Vector3.new(1, 0, 1)).Magnitude > 4
  485.   then
  486.    break
  487.   end
  488.  until tick() - Yield >= .17
  489. end
  490.  
  491. local function UpdateFooting()
  492.  if not VirtualRig:FindFirstChild("LowerTorso") then
  493.   wait()
  494.   return
  495.  end
  496.  
  497.  local Floor, FloorPosition, FloorNormal, Dist = FloorRay(VirtualRig.LowerTorso, 3)
  498.  
  499.  Dist = math.clamp(Dist, 0, 5)
  500.  
  501.  local FootTarget =
  502.   VirtualRig.LowerTorso.CFrame *
  503.   CFrame.new(FootPlacementSettings.RightOffset) -
  504.   Vector3.new(0, Dist, 0) +
  505.   Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8) * 2
  506.  
  507.  if FootReady(VirtualRig.RightFoot, FootTarget) then
  508.   VirtualRig.RightFoot.BodyPosition.Position = FootTarget.p
  509.   VirtualRig.RightFoot.BodyGyro.CFrame = Flatten(VirtualRig.LowerTorso.CFrame)
  510.  end
  511.  
  512.  FootYield()
  513.  
  514.  local FootTarget =
  515.   VirtualRig.LowerTorso.CFrame *
  516.   CFrame.new(FootPlacementSettings.LeftOffset) -
  517.   Vector3.new(0, Dist, 0) +
  518.   Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8) * 2
  519.  
  520.  if FootReady(VirtualRig.LeftFoot, FootTarget) then
  521.   VirtualRig.LeftFoot.BodyPosition.Position = FootTarget.p
  522.   VirtualRig.LeftFoot.BodyGyro.CFrame = Flatten(VirtualRig.LowerTorso.CFrame)
  523.  end
  524. end
  525.  
  526. local function UpdateTorsoPosition()
  527.  if not RagdollEnabled then
  528.   if TorsoHandle then
  529.    local Positioning = VirtualRig.UpperTorso.CFrame
  530.    
  531.    if not TorsoGrip or not TorsoGrip.Parent then
  532.     TorsoGrip = CreateRightGrip(TorsoHandle)
  533.    end
  534.    
  535.    local Parent = TorsoGrip.Parent
  536.    
  537.    TorsoGrip.C1 = CFrame.new()
  538.    TorsoGrip.C0 = TorsoGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * CFrame.new(0, -0.25, 0) * AccessorySettings.LimbOffset), Smoothness)
  539.    TorsoGrip.Parent = nil
  540.    TorsoGrip.Parent = Parent
  541.   end
  542.  else
  543.   local Positioning = VirtualRig.UpperTorso.CFrame
  544.  
  545.   MoveTorso(Positioning * CFrame.new(0, -0.25, 0))
  546.   MoveRoot(Positioning * CFrame.new(0, -0.25, 0))
  547.  end
  548. end
  549.  
  550. local function UpdateLegPosition()
  551.  if not RagdollEnabled then
  552.   if RightHipHandle then
  553.    local Positioning =
  554.     VirtualRig.RightLowerLeg.CFrame
  555.     : Lerp(VirtualRig.RightFoot.CFrame, 0.5)
  556.     + Vector3.new(0, 0.5, 0)
  557.    
  558.    if not RightHipHandle or not RightHipHandle.Parent then
  559.     RightLegGrip = CreateRightGrip(RightHipHandle)
  560.    end
  561.    
  562.    local Parent = RightLegGrip.Parent
  563.    
  564.    RightLegGrip.C1 = CFrame.new()
  565.    RightLegGrip.C0 = RightLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * AccessorySettings.LimbOffset), Smoothness)
  566.    RightLegGrip.Parent = nil
  567.    RightLegGrip.Parent = Parent
  568.   end
  569.  
  570.   if LeftHipHandle then
  571.    local Positioning =
  572.     VirtualRig.LeftLowerLeg.CFrame
  573.     : Lerp(VirtualRig.LeftFoot.CFrame, 0.5)
  574.     + Vector3.new(0, 0.5, 0)
  575.    
  576.    if not LeftLegGrip or not LeftLegGrip.Parent then
  577.     LeftLegGrip = CreateRightGrip(LeftHipHandle)
  578.    end
  579.    
  580.    local Parent = LeftLegGrip.Parent
  581.    
  582.    LeftLegGrip.C1 = CFrame.new()
  583.    LeftLegGrip.C0 = LeftLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * AccessorySettings.LimbOffset), Smoothness)
  584.    LeftLegGrip.Parent = nil
  585.    LeftLegGrip.Parent = Parent
  586.   end
  587.  else
  588.   do
  589.    local Positioning =
  590.     VirtualRig.RightLowerLeg.CFrame
  591.     : Lerp(VirtualRig.RightFoot.CFrame, 0.5)
  592.     * CFrame.Angles(0, math.rad(180), 0)
  593.     + Vector3.new(0, 0.5, 0)
  594.    
  595.    MoveRightLeg(Positioning)
  596.   end
  597.  
  598.   do
  599.    local Positioning =
  600.     VirtualRig.LeftLowerLeg.CFrame
  601.     : Lerp(VirtualRig.LeftFoot.CFrame, 0.5)
  602.     * CFrame.Angles(0, math.rad(180), 0)
  603.     + Vector3.new(0, 0.5, 0)
  604.    
  605.    MoveLeftLeg(Positioning)
  606.   end
  607.  end
  608. end
  609.  
  610. warn("VRReady is", VRReady)
  611.  
  612. local function OnUserCFrameChanged(UserCFrame, Positioning, IgnoreTorso)
  613.  local Positioning = Camera.CFrame * Positioning
  614.  
  615.  if not IgnoreTorso then
  616.   UpdateTorsoPosition()
  617.   UpdateLegPosition()
  618.  end
  619.  
  620.  if not RagdollEnabled then
  621.   if UserCFrame == Enum.UserCFrame.Head and AccessorySettings.Head then
  622.    for _, Table in next, HeadAccessories do
  623.     local Handle, RightGrip, HatAtt, HeadAtt, BasePart = unpack(Table)
  624.     local LocalPositioning = Positioning
  625.    
  626.     if not RightGrip or not RightGrip.Parent then
  627.      RightGrip = CreateRightGrip(Handle)
  628.      Table[2] = RightGrip
  629.     end
  630.    
  631.     local Parent = RightGrip.Parent
  632.    
  633.     if BasePart then
  634.      LocalPositioning = BasePart.CFrame * HeadAtt
  635.     end
  636.    
  637.     RightGrip.C1 = HatAtt
  638.     RightGrip.C0 = RightGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(LocalPositioning), Smoothness)
  639.     RightGrip.Parent = nil
  640.     RightGrip.Parent = Parent
  641.    end
  642.    
  643.   elseif RightHandle and UserCFrame == Enum.UserCFrame.RightHand and AccessorySettings.RightArm then
  644.    local HandPosition = Positioning
  645.    local LocalPositioning = Positioning
  646.    
  647.    if not RightHandGrip or not RightHandGrip.Parent then
  648.     RightHandGrip = CreateRightGrip(RightHandle)
  649.    end
  650.    
  651.    if AccurateHandPosition then
  652.     HandPosition = HandPosition * CFrame.new(0, 0, 1)
  653.    end
  654.    
  655.    if not VRReady then
  656.     local HeadRotation = Camera.CFrame - Camera.CFrame.p
  657.    
  658.     HandPosition = VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5) * AccessorySettings.LimbOffset
  659.    
  660.     --LocalPositioning = (HeadRotation + (HandPosition * CFrame.new(0, 0, 1)).p) * CFrame.Angles(math.rad(-45), 0, 0)
  661.     LocalPositioning = HandPosition * CFrame.new(0, 0, 1) * CFrame.Angles(math.rad(-180), 0, 0)
  662.    
  663.     if Point2 then
  664.      VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  665.      VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  666.     elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  667.      VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  668.     end
  669.    elseif AccurateHandPosition then
  670.     LocalPositioning = HandPosition
  671.    end
  672.    
  673.    local Parent = RightHandGrip.Parent
  674.    
  675.    RightHandGrip.C1 = CFrame.new()
  676.    RightHandGrip.C0 = RightHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)
  677.    RightHandGrip.Parent = nil
  678.    RightHandGrip.Parent = Parent
  679.    
  680.    --
  681.    
  682.    local EquippedTool = GetExtraTool()
  683.    
  684.    if EquippedTool and EquippedTool:FindFirstChild("Handle") then
  685.     local EquippedGrip = GetGripForHandle(EquippedTool.Handle)
  686.     local Parent = EquippedGrip.Parent
  687.    
  688.     local ArmBaseCFrame = ArmBase.CFrame
  689.     if ArmBase.Name == "Right Arm" then
  690.      ArmBaseCFrame = ArmBaseCFrame
  691.     end
  692.    
  693.     EquippedGrip.C1 = EquippedTool.Grip
  694.     EquippedGrip.C0 = EquippedGrip.C0:Lerp(ArmBaseCFrame:ToObjectSpace(LocalPositioning), Smoothness)
  695.     EquippedGrip.Parent = nil
  696.     EquippedGrip.Parent = Parent
  697.    end
  698.    
  699.   elseif LeftHandle and UserCFrame == Enum.UserCFrame.LeftHand and AccessorySettings.LeftArm then
  700.    local HandPosition = Positioning
  701.    
  702.    if not LeftHandGrip or not LeftHandGrip.Parent then
  703.     LeftHandGrip = CreateRightGrip(LeftHandle)
  704.    end
  705.    
  706.    if AccurateHandPosition then
  707.     HandPosition = HandPosition * CFrame.new(0, 0, 1)
  708.    end
  709.    
  710.    if not VRReady then
  711.     HandPosition = VirtualRig.LeftUpperArm.CFrame:Lerp(VirtualRig.LeftLowerArm.CFrame, 0.5) * AccessorySettings.LimbOffset
  712.     --warn("Setting HandPosition to hands")
  713.     if Point1 then
  714.      VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  715.      VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  716.     elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  717.      VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  718.     end
  719.    end
  720.    
  721.    local Parent = LeftHandGrip.Parent
  722.    
  723.    LeftHandGrip.C1 = CFrame.new()
  724.    LeftHandGrip.C0 = LeftHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)
  725.    LeftHandGrip.Parent = nil
  726.    LeftHandGrip.Parent = Parent
  727.    
  728.   end
  729.  end
  730.  
  731.  if RagdollEnabled then
  732.   if UserCFrame == Enum.UserCFrame.Head and RagdollHeadMovement then
  733.    MoveHead(Positioning)
  734.   elseif UserCFrame == Enum.UserCFrame.RightHand then
  735.    local Positioning = Positioning
  736.    
  737.    if not VRReady then
  738.     Positioning = VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5)
  739.    elseif AccurateHandPosition then
  740.     Positioning = Positioning * CFrame.new(0, 0, 1)
  741.    end
  742.    
  743.    if VRReady then
  744.     Positioning = Positioning * AccessorySettings.LimbOffset
  745.    end
  746.    
  747.    MoveRightArm(Positioning)
  748.    
  749.    if Point2 then
  750.     VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  751.     VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  752.    elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  753.     VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  754.    end
  755.   elseif UserCFrame == Enum.UserCFrame.LeftHand then
  756.    local Positioning = Positioning
  757.    
  758.    if not VRReady then
  759.     Positioning = VirtualRig.LeftUpperArm.CFrame:Lerp(VirtualRig.LeftLowerArm.CFrame, 0.5)
  760.    elseif AccurateHandPosition then
  761.     Positioning = Positioning * CFrame.new(0, 0, 1)
  762.    end
  763.    
  764.    if VRReady then
  765.     Positioning = Positioning * AccessorySettings.LimbOffset
  766.    end
  767.    
  768.    MoveLeftArm(Positioning)
  769.    
  770.    if Point1 then
  771.     VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  772.     VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset
  773.    elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then
  774.     VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)
  775.    end
  776.   end
  777.  end
  778.  
  779.  if UserCFrame == Enum.UserCFrame.Head then
  780.   VirtualRig.Head.CFrame = Positioning
  781.  
  782.  elseif UserCFrame == Enum.UserCFrame.RightHand and VRReady then
  783.   VirtualRig.RightHand.CFrame = Positioning
  784.  
  785.  elseif UserCFrame == Enum.UserCFrame.LeftHand and VRReady then
  786.   VirtualRig.LeftHand.CFrame = Positioning
  787.  
  788.  end
  789.  
  790.  if not VRReady and VirtualRig.LeftHand.Anchored then
  791.   VirtualRig.RightHand.Anchored = false
  792.   VirtualRig.LeftHand.Anchored = false
  793.  elseif VRReady and not VirtualRig.LeftHand.Anchored then
  794.   VirtualRig.RightHand.Anchored = true
  795.   VirtualRig.LeftHand.Anchored = true
  796.  end
  797. end
  798.  
  799. local CFrameChanged = VRService.UserCFrameChanged:Connect(OnUserCFrameChanged)
  800.  
  801. local OnStepped = RunService.Stepped:Connect(function()
  802.  for _, Part in pairs(VirtualRig:GetChildren()) do
  803.   if Part:IsA("BasePart") then
  804.    Part.CanCollide = false
  805.   end
  806.  end
  807.  
  808.  if RagdollEnabled then
  809.   for _, Part in pairs(Character:GetChildren()) do
  810.    if Part:IsA("BasePart") then
  811.     Part.CanCollide = false
  812.    end
  813.   end
  814.  end
  815.  
  816.  if NoCollision then
  817.   for _, Player in pairs(Players:GetPlayers()) do
  818.    if Player ~= Client and Player.Character then
  819.     local Descendants = Player.Character:GetDescendants()
  820.     for i = 1, #Descendants do
  821.      local Part = Descendants[i]
  822.      if Part:IsA("BasePart") then
  823.       Part.CanCollide = false
  824.       Part.Velocity = Vector3.new()
  825.       Part.RotVelocity = Vector3.new()
  826.      end
  827.     end
  828.    end
  829.   end
  830.  end
  831. end)
  832.  
  833. local OnRenderStepped = RunService.Stepped:Connect(function()
  834.  Camera.CameraSubject = VirtualBody.Humanoid
  835.  
  836.  if RagdollEnabled then
  837.   Character.HumanoidRootPart.CFrame = VirtualRig.UpperTorso.CFrame
  838.   Character.HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
  839.  end
  840.  
  841.  if not VRReady then
  842.   OnUserCFrameChanged(Enum.UserCFrame.Head, CFrame.new(0, 0, 0))
  843.  
  844.   OnUserCFrameChanged(Enum.UserCFrame.RightHand, CFrame.new(0, 0, 0), true)
  845.   OnUserCFrameChanged(Enum.UserCFrame.LeftHand, CFrame.new(0, 0, 0), true)
  846.  end
  847. end)
  848.  
  849. spawn(function()
  850.  while Character and Character.Parent do
  851.   FootYield()
  852.   UpdateFooting()
  853.  end
  854. end)
  855.  
  856. --[[
  857.  Non-VR Support + VR Mechanics
  858. --]]
  859.  
  860. local OnInput = UserInputService.InputBegan:Connect(function(Input, Processed)
  861.  if not Processed then
  862.   if Input.KeyCode == Enum.KeyCode.LeftControl or Input.KeyCode == Enum.KeyCode.ButtonL2 then
  863.    Tween(VirtualBody.Humanoid, "Elastic", "Out", 1, {
  864.     CameraOffset = Vector3.new(0, StudsOffset - 1.5, 0)
  865.    })
  866.   end
  867.  
  868.   if Input.KeyCode == Enum.KeyCode.X then
  869.    if RagdollEnabled and RagdollHeadMovement then
  870.     Network:Unclaim()
  871.     Respawn()
  872.    end
  873.   end
  874.  
  875.   if Input.KeyCode == Enum.KeyCode.C then
  876.    VirtualBody:MoveTo(Mouse.Hit.p)
  877.    VirtualRig:MoveTo(Mouse.Hit.p)
  878.   end
  879.  end
  880.  
  881.  if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.ButtonR2 then
  882.   Tween(VirtualBody.Humanoid, "Sine", "Out", 1, {
  883.    WalkSpeed = 16
  884.   })
  885.  end
  886.  
  887.  if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton1 then
  888.   Point1 = true
  889.  end
  890.  
  891.  if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton2 then
  892.   Point2 = true
  893.  end
  894.  
  895.  if VRReady and Input.KeyCode == Enum.KeyCode.ButtonY then
  896.   Character:BreakJoints()
  897.  
  898.   if RagdollEnabled and RagdollHeadMovement then
  899.    Network:Unclaim()
  900.    Respawn()
  901.   end
  902.  end
  903. end)
  904.  
  905. local OnInputEnded = UserInputService.InputEnded:Connect(function(Input, Processed)
  906.  if not Processed then
  907.   if Input.KeyCode == Enum.KeyCode.LeftControl or Input.KeyCode == Enum.KeyCode.ButtonL2 then
  908.    Tween(VirtualBody.Humanoid, "Elastic", "Out", 1, {
  909.     CameraOffset = Vector3.new(0, StudsOffset, 0)
  910.    })
  911.   end
  912.  end
  913.  
  914.  if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.ButtonR2 then
  915.   Tween(VirtualBody.Humanoid, "Sine", "Out", 1, {
  916.    WalkSpeed = 8
  917.   })
  918.  end
  919.  
  920.  if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton1 then
  921.   Point1 = false
  922.  end
  923.  
  924.  if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton2 then
  925.   Point2 = false
  926.  end
  927. end)
  928.  
  929. --[[
  930.  Proper Cleanup
  931. --]]
  932.  
  933. local OnReset
  934.  
  935. OnReset = Client.CharacterAdded:Connect(function()
  936.  OnReset:Disconnect();
  937.  CFrameChanged:Disconnect();
  938.  OnStepped:Disconnect();
  939.  OnRenderStepped:Disconnect();
  940.  OnMoving:Disconnect();
  941.  OnInput:Disconnect();
  942.  OnInputEnded:Disconnect();
  943.  
  944.  VirtualRig:Destroy();
  945.  VirtualBody:Destroy();
  946.  
  947.  if RagdollEnabled then
  948.   Network:Unclaim();
  949.  end
  950.  
  951.  if AutoRun then
  952.   delay(2, function()
  953.    Script()
  954.   end)
  955.  end
  956. end)
  957.  
  958. if ChatEnabled then
  959.  spawn(ChatHUDFunc)
  960. end
  961.  
  962. if ViewportEnabled then
  963.  spawn(ViewHUDFunc)
  964. end
  965.  
  966. do
  967.  --[[
  968.   Functions
  969.  --]]
  970.  
  971.  local Players = game:GetService("Players")
  972.   local Client = Players.LocalPlayer
  973.  
  974.  local VRService = game:GetService("VRService")
  975.   local VRReady = VRService.VREnabled
  976.  
  977.  local UserInputService = game:GetService("UserInputService")
  978.  local RunService = game:GetService("RunService")
  979.  
  980.  local Camera = workspace.CurrentCamera
  981.  
  982.  --[[
  983.   Code
  984.  --]]
  985.  
  986.  if VRReady then
  987.   local Pointer = game:GetObjects("rbxassetid://4476173280")[1]
  988.  
  989.   Pointer.Parent = workspace
  990.   Pointer.Beam.Enabled = false
  991.   Pointer.Target.ParticleEmitter.Enabled = false
  992.  
  993.   local RenderStepped = RunService.RenderStepped:Connect(function()
  994.    if Pointer.Beam.Enabled then
  995.     local RightHand = Camera.CFrame * VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
  996.     local Target = RightHand * CFrame.new(0, 0, -10)
  997.    
  998.     local Line = Ray.new(RightHand.p, (Target.p - RightHand.p).Unit * 128)
  999.     local Part, Position = workspace:FindPartOnRayWithIgnoreList(Line, {VirtualRig, VirtualBody, Character, Pointer})
  1000.    
  1001.     local Distance = (Position - RightHand.p).Magnitude
  1002.    
  1003.     Pointer.Target.Position = Vector3.new(0, 0, -Distance)
  1004.     Pointer.CFrame = RightHand
  1005.    end
  1006.   end)
  1007.  
  1008.   local Input = UserInputService.InputBegan:Connect(function(Input)
  1009.    if Input.KeyCode == Enum.KeyCode.ButtonB then
  1010.     Pointer.Beam.Enabled = not Pointer.Beam.Enabled
  1011.     Pointer.Target.ParticleEmitter.Enabled = not Pointer.Target.ParticleEmitter.Enabled
  1012.    end
  1013.   end)
  1014.  
  1015.   --
  1016.  
  1017.   local CharacterAdded
  1018.  
  1019.   CharacterAdded = Client.CharacterAdded:Connect(function()
  1020.    RenderStepped:Disconnect()
  1021.    Input:Disconnect()
  1022.    CharacterAdded:Disconnect()
  1023.    
  1024.    Pointer:Destroy()
  1025.    Pointer = nil
  1026.   end)
  1027.  else
  1028.   return
  1029.  end
  1030. end
  1031.  
  1032. end;
  1033.  
  1034. Permadeath = function()
  1035.  local ch = game.Players.LocalPlayer.Character
  1036.  local prt=Instance.new("Model", workspace)
  1037.  local z1 =  Instance.new("Part", prt)
  1038.  z1.Name="Torso"
  1039.  z1.CanCollide = false
  1040.  z1.Anchored = true
  1041.  local z2  =Instance.new("Part", prt)
  1042.  z2.Name="Head"
  1043.  z2.Anchored = true
  1044.  z2.CanCollide = false
  1045.  local z3 =Instance.new("Humanoid", prt)
  1046.  z3.Name="Humanoid"
  1047.  z1.Position = Vector3.new(0,9999,0)
  1048.  z2.Position = Vector3.new(0,9991,0)
  1049.  game.Players.LocalPlayer.Character=prt
  1050.  wait(5)
  1051.  warn("50%")
  1052.  game.Players.LocalPlayer.Character=ch
  1053.  wait(6)
  1054.  warn("100%")
  1055. end;
  1056.  
  1057. Respawn = function()
  1058.  local ch = game.Players.LocalPlayer.Character
  1059.  
  1060.  local prt=Instance.new("Model", workspace)
  1061.  local z1 =  Instance.new("Part", prt)
  1062.  z1.Name="Torso"
  1063.  z1.CanCollide = false
  1064.  z1.Anchored = true
  1065.  local z2  =Instance.new("Part", prt)
  1066.  z2.Name="Head"
  1067.  z2.Anchored = true
  1068.  z2.CanCollide = false
  1069.  local z3 =Instance.new("Humanoid", prt)
  1070.  z3.Name="Humanoid"
  1071.  z1.Position = Vector3.new(0,9999,0)
  1072.  z2.Position = Vector3.new(0,9991,0)
  1073.  game.Players.LocalPlayer.Character=prt
  1074.  wait(5)
  1075.  game.Players.LocalPlayer.Character=ch
  1076. end;
  1077.  
  1078. ChatHUDFunc = function()
  1079.  --[[
  1080.   Variables
  1081.  --]]
  1082.  
  1083.  local UserInputService = game:GetService("UserInputService")
  1084.  local RunService = game:GetService("RunService")
  1085.  
  1086.  local VRService = game:GetService("VRService")
  1087.   local VRReady = VRService.VREnabled
  1088.  
  1089.  local Players = game:GetService("Players")
  1090.   local Client = Players.LocalPlayer
  1091.  
  1092.  local ChatHUD = game:GetObjects("rbxassetid://4476067885")[1]
  1093.   local GlobalFrame = ChatHUD.GlobalFrame
  1094.    local Template = GlobalFrame.Template
  1095.   local LocalFrame = ChatHUD.LocalFrame
  1096.   local Global = ChatHUD.Global
  1097.   local Local = ChatHUD.Local
  1098.  
  1099.  local Camera = workspace.CurrentCamera
  1100.  
  1101.  Template.Parent = nil
  1102.  ChatHUD.Parent = game:GetService("CoreGui")
  1103.  
  1104.  --[[
  1105.   Code
  1106.  --]]
  1107.  
  1108.  local Highlight = Global.Frame.BackgroundColor3
  1109.  local Deselected = Local.Frame.BackgroundColor3
  1110.  
  1111.  local OpenGlobalTab = function()
  1112.   Global.Frame.BackgroundColor3 = Highlight
  1113.   Local.Frame.BackgroundColor3 = Deselected
  1114.  
  1115.   Global.Font = Enum.Font.SourceSansBold
  1116.   Local.Font = Enum.Font.SourceSans
  1117.  
  1118.   GlobalFrame.Visible = true
  1119.   LocalFrame.Visible = false
  1120.  end
  1121.  
  1122.  local OpenLocalTab = function()
  1123.   Global.Frame.BackgroundColor3 = Deselected
  1124.   Local.Frame.BackgroundColor3 = Highlight
  1125.  
  1126.   Global.Font = Enum.Font.SourceSans
  1127.   Local.Font = Enum.Font.SourceSansBold
  1128.  
  1129.   GlobalFrame.Visible = false
  1130.   LocalFrame.Visible = true
  1131.  end
  1132.  
  1133.  Global.MouseButton1Down:Connect(OpenGlobalTab)
  1134.  Local.MouseButton1Down:Connect(OpenLocalTab)
  1135.  Global.MouseButton1Click:Connect(OpenGlobalTab)
  1136.  Local.MouseButton1Click:Connect(OpenLocalTab)
  1137.  
  1138.  OpenLocalTab()
  1139.  
  1140.  --
  1141.  
  1142.  local function GetPlayerDistance(Sender)
  1143.   if Sender.Character and Sender.Character:FindFirstChild("Head") then
  1144.    return math.floor((Sender.Character.Head.Position - Camera:GetRenderCFrame().p).Magnitude + 0.5)
  1145.   end
  1146.  end
  1147.  
  1148.  local function NewGlobal(Message, Sender, Color)
  1149.   local Frame = Template:Clone()
  1150.  
  1151.   Frame.Text = ("[%s]: %s"):format(Sender.Name, Message)
  1152.   Frame.User.Text = ("[%s]:"):format(Sender.Name)
  1153.   Frame.User.TextColor3 = Color
  1154.   Frame.BackgroundColor3 = Color
  1155.   Frame.Parent = GlobalFrame
  1156.  
  1157.   delay(60, function()
  1158.    Frame:Destroy()
  1159.   end)
  1160.  end
  1161.  
  1162.  local function NewLocal(Message, Sender, Color, Dist)
  1163.   local Frame = Template:Clone()
  1164.  
  1165.   Frame.Text = ("(%s) [%s]: %s"):format(tostring(Dist), Sender.Name, Message)
  1166.   Frame.User.Text = ("(%s) [%s]:"):format(tostring(Dist), Sender.Name)
  1167.   Frame.User.TextColor3 = Color
  1168.   Frame.BackgroundColor3 = Color
  1169.   Frame.Parent = LocalFrame
  1170.  
  1171.   delay(60, function()
  1172.    Frame:Destroy()
  1173.   end)
  1174.  end
  1175.  
  1176.  local function OnNewChat(Message, Sender, Color)
  1177.   if not ChatHUD or not ChatHUD.Parent then return end
  1178.  
  1179.   NewGlobal(Message, Sender, Color)
  1180.  
  1181.   local Distance = GetPlayerDistance(Sender)
  1182.  
  1183.   if Distance and Distance <= ChatLocalRange then
  1184.    NewLocal(Message, Sender, Color, Distance)
  1185.   end
  1186.  end
  1187.  
  1188.  local function OnPlayerAdded(Player)
  1189.   if not ChatHUD or not ChatHUD.Parent then return end
  1190.  
  1191.   local Color = BrickColor.Random().Color
  1192.  
  1193.   Player.Chatted:Connect(function(Message)
  1194.    OnNewChat(Message, Player, Color)
  1195.   end)
  1196.  end
  1197.  
  1198.  Players.PlayerAdded:Connect(OnPlayerAdded)
  1199.  
  1200.  for _, Player in pairs(Players:GetPlayers()) do
  1201.   OnPlayerAdded(Player)
  1202.  end
  1203.  
  1204.  --
  1205.  
  1206.  local ChatPart = ChatHUD.Part
  1207.  
  1208.  ChatHUD.Adornee = ChatPart
  1209.  
  1210.  if VRReady then
  1211.   ChatHUD.Parent = game:GetService("CoreGui")
  1212.   ChatHUD.Enabled = true
  1213.   ChatHUD.AlwaysOnTop = true
  1214.  
  1215.   local OnInput = UserInputService.InputBegan:Connect(function(Input, Processed)
  1216.    if not Processed then
  1217.     if Input.KeyCode == Enum.KeyCode.ButtonX then
  1218.      ChatHUD.Enabled = not ChatHUD.Enabled
  1219.     end
  1220.    end
  1221.   end)
  1222.  
  1223.   local RenderStepped = RunService.RenderStepped:Connect(function()
  1224.    local LeftHand = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
  1225.    
  1226.    ChatPart.CFrame = Camera.CFrame * LeftHand
  1227.   end)
  1228.  
  1229.   local CharacterAdded
  1230.  
  1231.   CharacterAdded = Client.CharacterAdded:Connect(function()
  1232.    OnInput:Disconnect()
  1233.    RenderStepped:Disconnect()
  1234.    CharacterAdded:Disconnect()
  1235.    
  1236.    ChatHUD:Destroy()
  1237.    ChatHUD = nil
  1238.   end)
  1239.  end
  1240.  
  1241.  wait(9e9)
  1242. end;
  1243.  
  1244. ViewHUDFunc = function()
  1245.  --[[
  1246.   Variables
  1247.  --]]
  1248.  
  1249.  local ViewportRange = ViewportRange or 32
  1250.  
  1251.  local UserInputService = game:GetService("UserInputService")
  1252.  local RunService = game:GetService("RunService")
  1253.  
  1254.  local VRService = game:GetService("VRService")
  1255.   local VRReady = VRService.VREnabled
  1256.  
  1257.  local Players = game:GetService("Players")
  1258.   local Client = Players.LocalPlayer
  1259.    local Mouse = Client:GetMouse()
  1260.  
  1261.  local Camera = workspace.CurrentCamera
  1262.   local CameraPort = Camera.CFrame
  1263.  
  1264.  local ViewHUD = script:FindFirstChild("ViewHUD") or game:GetObjects("rbxassetid://4480405425")[1]
  1265.   local Viewport = ViewHUD.Viewport
  1266.    local Viewcam = Instance.new("Camera")
  1267.   local ViewPart = ViewHUD.Part
  1268.  
  1269.  ViewHUD.Parent = game:GetService("CoreGui")
  1270.  
  1271.  Viewcam.Parent = Viewport
  1272.  Viewcam.CameraType = Enum.CameraType.Scriptable
  1273.  Viewport.CurrentCamera = Viewcam
  1274.  Viewport.BackgroundTransparency = 1
  1275.  
  1276.  --[[
  1277.   Code
  1278.  --]]
  1279.  
  1280.  local function Clone(Character)
  1281.   local Arc = Character.Archivable
  1282.   local Clone;
  1283.  
  1284.   Character.Archivable = true
  1285.   Clone = Character:Clone()
  1286.   Character.Archivable = Arc
  1287.  
  1288.   return Clone
  1289.  end
  1290.  
  1291.  local function GetPart(Name, Parent, Descendants)
  1292.   for i = 1, #Descendants do
  1293.    local Part = Descendants[i]
  1294.    
  1295.    if Part.Name == Name and Part.Parent.Name == Parent then
  1296.     return Part
  1297.    end
  1298.   end
  1299.  end
  1300.  
  1301.  local function OnPlayerAdded(Player)
  1302.   if not ViewHUD or not ViewHUD.Parent then return end
  1303.  
  1304.   local function CharacterAdded(Character)
  1305.    if not ViewHUD or not ViewHUD.Parent then return end
  1306.    
  1307.    Character:WaitForChild("Head")
  1308.    Character:WaitForChild("Humanoid")
  1309.    
  1310.    wait(3)
  1311.    
  1312.    local FakeChar = Clone(Character)
  1313.    local Root = FakeChar:FindFirstChild("HumanoidRootPart") or FakeChar:FindFirstChild("Head")
  1314.    local RenderConnection;
  1315.    
  1316.    local Descendants = FakeChar:GetDescendants()
  1317.    local RealDescendants = Character:GetDescendants()
  1318.    local Correspondents = {};
  1319.    
  1320.    FakeChar.Humanoid.DisplayDistanceType = "None"
  1321.    
  1322.    for i = 1, #Descendants do
  1323.     local Part = Descendants[i]
  1324.     local Real = Part:IsA("BasePart") and GetPart(Part.Name, Part.Parent.Name, RealDescendants)
  1325.    
  1326.     if Part:IsA("BasePart") and Real then
  1327.      Part.Anchored = true
  1328.      Part:BreakJoints()
  1329.      
  1330.      if Part.Parent:IsA("Accessory") then
  1331.       Part.Transparency = 0
  1332.      end
  1333.      
  1334.      table.insert(Correspondents, {Part, Real})
  1335.     end
  1336.    end
  1337.    
  1338.    RenderConnection = RunService.RenderStepped:Connect(function()
  1339.     if not Character or not Character.Parent then
  1340.      RenderConnection:Disconnect()
  1341.      FakeChar:Destroy()
  1342.      
  1343.      return
  1344.     end
  1345.    
  1346.     if (Root and (Root.Position - Camera.CFrame.p).Magnitude <= ViewportRange) or Player == Client or not Root then
  1347.      for i = 1, #Correspondents do
  1348.       local Part, Real = unpack(Correspondents[i])
  1349.      
  1350.       if Part and Real and Part.Parent and Real.Parent then
  1351.        Part.CFrame = Real.CFrame
  1352.       elseif Part.Parent and not Real.Parent then
  1353.        Part:Destroy()
  1354.       end
  1355.      end
  1356.     end
  1357.    end)
  1358.    
  1359.    FakeChar.Parent = Viewcam
  1360.   end
  1361.  
  1362.   Player.CharacterAdded:Connect(CharacterAdded)
  1363.  
  1364.   if Player.Character then
  1365.    spawn(function()
  1366.     CharacterAdded(Player.Character)
  1367.    end)
  1368.   end
  1369.  end
  1370.  
  1371.  local PlayerAdded = Players.PlayerAdded:Connect(OnPlayerAdded)
  1372.  
  1373.  for _, Player in pairs(Players:GetPlayers()) do
  1374.   OnPlayerAdded(Player)
  1375.  end
  1376.  
  1377.  ViewPart.Size = Vector3.new()
  1378.  
  1379.  if VRReady then
  1380.   Viewport.Position = UDim2.new(.62, 0, .89, 0)
  1381.   Viewport.Size = UDim2.new(.3, 0, .3, 0)
  1382.   Viewport.AnchorPoint = Vector2.new(.5, 1)
  1383.  else
  1384.   Viewport.Size = UDim2.new(0.3, 0, 0.3, 0)
  1385.  end
  1386.  
  1387.  local RenderStepped = RunService.RenderStepped:Connect(function()
  1388.   local Render = Camera.CFrame
  1389.   local Scale = Camera.ViewportSize
  1390.  
  1391.   if VRReady then
  1392.    Render = Render * VRService:GetUserCFrame(Enum.UserCFrame.Head)
  1393.   end
  1394.  
  1395.   CameraPort = CFrame.new(Render.p + Vector3.new(5, 2, 0), Render.p)
  1396.  
  1397.   Viewport.Camera.CFrame = CameraPort
  1398.  
  1399.   ViewPart.CFrame = Render * CFrame.new(0, 0, -16)
  1400.  
  1401.   ViewHUD.Size = UDim2.new(0, Scale.X - 6, 0, Scale.Y - 6)
  1402.  end)
  1403.  
  1404.  --
  1405.  
  1406.  local CharacterAdded
  1407.  
  1408.  CharacterAdded = Client.CharacterAdded:Connect(function()
  1409.   RenderStepped:Disconnect()
  1410.   CharacterAdded:Disconnect()
  1411.   PlayerAdded:Disconnect()
  1412.  
  1413.   ViewHUD:Destroy()
  1414.   ViewHUD = nil
  1415.  end)
  1416.  
  1417.  wait(9e9)
  1418. end;
  1419.  
  1420. Script()
  1421.  
  1422. wait(2)
  1423.  
  1424. local Players = game:GetService("Players")
  1425. local lp = Players.LocalPlayer
  1426. local character = lp.Character
  1427. local A0LL = Instance.new("Attachment", character["Left Leg"])
  1428. A0LL.Position = Vector3.new(0, 1, 0)
  1429. local A1LL = Instance.new("Attachment", character["Torso"])
  1430. A1LL.Position = Vector3.new(-0.5, -1, 0)
  1431. local socket1 = Instance.new("BallSocketConstraint", character["Left Leg"])
  1432. socket1.Attachment0 = A0LL
  1433. socket1.Attachment1 = A1LL
  1434. local A0RL = Instance.new("Attachment", character["Right Leg"])
  1435. A0RL.Position = Vector3.new(0, 1, 0)
  1436. local A1RL = Instance.new("Attachment", character["Torso"])
  1437. A1RL.Position = Vector3.new(0.5, -1, 0)
  1438. local socket2 = Instance.new("BallSocketConstraint", character["Right Leg"])
  1439. socket2.Attachment0 = A0RL
  1440. socket2.Attachment1 = A1RL
  1441. local A0H = Instance.new("Attachment", character["Head"])
  1442. A0H.Position = Vector3.new(0, -0.5, 0)
  1443. local A1H = Instance.new("Attachment", character["Torso"])
  1444. A1H.Position = Vector3.new(0, 1, 0)
  1445. local socket5 = Instance.new("BallSocketConstraint", character["Head"])
  1446. socket5.Attachment0 = A0H
  1447. socket5.Attachment1 = A1H
  1448. loadstring(game:HttpGet("https://pastebin.com/raw/Byd1PdHn",true))()
  1449. -----------------------------------------------------------
  1450. wait(9e9)
  1451. warn("Enjoy to use fixed by lolkek352443!")



  • Recent Roblox Scripts