Advertisement
almola366

Untitled

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