Advertisement
SCRIPTCUSTOMIZER

yessir

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