Advertisement
Guest User

VR SCRIPT R6 R15

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