Advertisement
FabianRBLX

VR Sword

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