Advertisement
SiLENT_RBLX

R6 Vr LEAK

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