Advertisement
noobsad

Vr hub (Broken)

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