ImJustAsh

VR HANDS MOBILE

May 14th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.07 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer;
  2. local chr = plr.Character;
  3. local hum = chr.Humanoid;
  4.  
  5. --Making Controllable Gui
  6. local ScreenGui = Instance.new("ScreenGui", game.CoreGui)
  7.  
  8. local LeftHandRedParent = Instance.new("Frame",ScreenGui)
  9. local RightHandBlueParent = Instance.new("Frame",ScreenGui)
  10.  
  11. local LeftHandRed = Instance.new("Frame",LeftHandRedParent)
  12. local RightHandBlue = Instance.new("Frame",RightHandBlueParent)
  13.  
  14. LeftHandRedParent.BackgroundColor3 = Color3.new(0.5, 0.0, 0.0)
  15. LeftHandRedParent.Position = UDim2.new(0.25, 0, 0.3, 0)
  16. LeftHandRedParent.Size = UDim2.new(0, 50, 0, 50)
  17.  
  18. RightHandBlueParent.BackgroundColor3 = Color3.new(0.0, 0.0, 0.5)
  19. RightHandBlueParent.Position = UDim2.new(0.60, 0.0, 0.3, 0.0)
  20. RightHandBlueParent.Size = UDim2.new(0, 50, 0, 50)
  21.  
  22. LeftHandRed.BackgroundColor3 = Color3.new(1.0, 0.0, 0.0)
  23. LeftHandRed.Position = UDim2.new(0.0, 0, 0.0, 0)
  24. LeftHandRed.Size = UDim2.new(0.8,0,0.8,0.0)
  25. LeftHandRed.Active = true
  26. LeftHandRed.Draggable = true
  27.  
  28. RightHandBlue.BackgroundColor3 = Color3.new(0.0, 0.0, 1.0)
  29. RightHandBlue.Size = UDim2.new(0.8,0,0.8,0.0)
  30. RightHandBlue.Active = true
  31. RightHandBlue.Draggable = true
  32.  
  33. --armfirstperson
  34.  
  35. local LEFTARMFIRSTPERSON = Instance.new("Part", game.Workspace)
  36. LEFTARMFIRSTPERSON.Size = Vector3.new(chr["Left Arm"].Size.X * 0.7,chr["Left Arm"].Size.Y * 0.7,chr["Left Arm"].Size.Z * 0.7)
  37. LEFTARMFIRSTPERSON.CanCollide = false
  38. LEFTARMFIRSTPERSON.Transparency = 0.3
  39. LEFTARMFIRSTPERSON.Anchored = true
  40.  
  41. local RIGHTARMFIRSTPERSON = Instance.new("Part", game.Workspace)
  42. RIGHTARMFIRSTPERSON.Size = Vector3.new(chr["Left Arm"].Size.X * 0.7,chr["Left Arm"].Size.Y * 0.7,chr["Left Arm"].Size.Z * 0.7)
  43. RIGHTARMFIRSTPERSON.CanCollide = false
  44. RIGHTARMFIRSTPERSON.Transparency = 0.3
  45. RIGHTARMFIRSTPERSON.Anchored = true
  46.  
  47. wait()
  48.  
  49. chr:SetPrimaryPartCFrame(chr.Torso.CFrame * CFrame.Angles(0,math.rad(0),0))
  50.  
  51. wait()
  52.  
  53. game.Players.LocalPlayer.character.HumanoidRootPart.CFrame = CFrame.new(game.Players.LocalPlayer.character.HumanoidRootPart.Position.x,game.Players.LocalPlayer.character.HumanoidRootPart.Position.y,game.Players.LocalPlayer.character.HumanoidRootPart.Position.z)
  54.  
  55. wait()
  56.  
  57. chr["Right Arm"]:BreakJoints()
  58. chr["Left Arm"]:BreakJoints()
  59. chr["Right Leg"]:BreakJoints()
  60. chr["Left Leg"]:BreakJoints()
  61.  
  62. chr.Torso.CanCollide = false
  63. chr["Right Arm"].CanCollide = true
  64. chr["Left Arm"].CanCollide = true
  65. chr["Right Leg"].CanCollide = true
  66. chr["Left Leg"].CanCollide = true
  67.  
  68. local RightArm0 = Instance.new("Attachment", chr["Right Arm"])
  69. RightArm0.Position = Vector3.new(0.15, 1, 0)
  70. local RightArm1 = Instance.new("Attachment", chr["Torso"])
  71. RightArm1.Position = Vector3.new(1.65, 0.85, 0)
  72. local socket1 = Instance.new("BallSocketConstraint", chr["Right Arm"])
  73. socket1.Attachment0 = RightArm0
  74. socket1.Attachment1 = RightArm1
  75.  
  76. local LeftArm0 = Instance.new("Attachment", chr["Left Arm"])
  77. LeftArm0.Position = Vector3.new(-0.15, 1, 0)
  78. local LeftArm1 = Instance.new("Attachment", chr["Torso"])
  79. LeftArm1.Position = Vector3.new(-1.65, 0.85, 0)
  80. local socket2 = Instance.new("BallSocketConstraint", chr["Left Arm"])
  81. socket2.Attachment0 = LeftArm0
  82. socket2.Attachment1 = LeftArm1
  83.  
  84. local RightRopeLeg0 = Instance.new("Attachment", chr["Right Leg"])
  85. RightRopeLeg0.Position = Vector3.new(0, 1, 0)
  86. local RightRopeLeg1 = Instance.new("Attachment", chr["Torso"])
  87. RightRopeLeg1.Position = Vector3.new(0.35, 1, 0)
  88. local socket3 = Instance.new("RopeConstraint", chr["Right Leg"])
  89. socket3.Attachment0 = RightRopeLeg0
  90. socket3.Attachment1 = RightRopeLeg1
  91.  
  92. local LeftRopeLeg0 = Instance.new("Attachment", chr["Left Leg"])
  93. LeftRopeLeg0.Position = Vector3.new(0, 1, 0)
  94. local LeftRopeLeg1 = Instance.new("Attachment", chr["Torso"])
  95. LeftRopeLeg1.Position = Vector3.new(-0.35, 1, 0)
  96. local socket4 = Instance.new("RopeConstraint", chr["Left Leg"])
  97. socket4.Attachment0 = LeftRopeLeg0
  98. socket4.Attachment1 = LeftRopeLeg1
  99.  
  100. --Lerp part 0
  101. local RightLeg0 = Instance.new("Attachment", chr["Torso"])
  102. RightLeg0.WorldPosition = chr["Right Leg"].Position
  103.  
  104. local LeftLeg0 = Instance.new("Attachment", chr["Torso"])
  105. LeftLeg0.WorldPosition = chr["Left Leg"].Position
  106.  
  107. --Lerp part 1
  108. local RightLeg1 = Instance.new("Attachment", chr["Torso"])
  109. RightLeg1.WorldPosition = Vector3.new(chr["Right Leg"].Position.X,chr["Right Leg"].Position.Y + 1.0,chr["Right Leg"].Position.Z - 1.0)
  110.  
  111. local LeftLeg1 = Instance.new("Attachment", chr["Torso"])
  112. LeftLeg1.WorldPosition = Vector3.new(chr["Left Leg"].Position.X,chr["Left Leg"].Position.Y + 1.0,chr["Left Leg"].Position.Z - 1.0)
  113.  
  114. --Lerp part 2
  115. local RightLeg2 = Instance.new("Attachment", chr["Torso"])
  116. RightLeg2.WorldPosition = Vector3.new(chr["Right Leg"].Position.X,chr["Right Leg"].Position.Y,chr["Right Leg"].Position.Z - 0.5)
  117.  
  118. local LeftLeg2 = Instance.new("Attachment", chr["Torso"])
  119. LeftLeg2.WorldPosition = Vector3.new(chr["Left Leg"].Position.X,chr["Left Leg"].Position.Y,chr["Left Leg"].Position.Z - 0.5)
  120.  
  121. --Lerp part 3
  122. local RightLeg3 = Instance.new("Attachment", chr["Torso"])
  123. RightLeg3.WorldPosition = Vector3.new(chr["Right Leg"].Position.X,chr["Right Leg"].Position.Y,chr["Right Leg"].Position.Z + 0.2)
  124.  
  125. local LeftLeg3 = Instance.new("Attachment", chr["Torso"])
  126. LeftLeg3.WorldPosition = Vector3.new(chr["Left Leg"].Position.X,chr["Left Leg"].Position.Y,chr["Left Leg"].Position.Z + 0.2)
  127.  
  128. LegsPart = 0
  129.  
  130. game:GetService("RunService").Heartbeat:connect(function()
  131.  
  132. --arms
  133. chr["Right Arm"].Orientation = Vector3.new(chr.Torso.Orientation.X - RightHandBlue.Position.Y.Offset,chr.Torso.Orientation.Y - RightHandBlue.Position.X.Offset,chr.Torso.Orientation.Z)
  134. chr["Left Arm"].Orientation = Vector3.new(chr.Torso.Orientation.X - LeftHandRed.Position.Y.Offset,chr.Torso.Orientation.Y + LeftHandRed.Position.X.Offset,chr.Torso.Orientation.Z )
  135.  
  136. --In First Person Arm
  137. RIGHTARMFIRSTPERSON.CFrame = RIGHTARMFIRSTPERSON.CFrame:Lerp(chr["Right Arm"].CFrame, 0.7)
  138. LEFTARMFIRSTPERSON.CFrame = LEFTARMFIRSTPERSON.CFrame:Lerp(chr["Left Arm"].CFrame, 0.7)
  139.  
  140. chr.Head.Velocity = Vector3.new(0,3,0)
  141. chr.Torso.Velocity = Vector3.new(0,3,0)
  142. chr["Right Arm"].Velocity = Vector3.new(0,3,0)
  143. chr["Left Arm"].Velocity = Vector3.new(0,3,0)
  144. chr["Right Leg"].Velocity = Vector3.new(0,3,0)
  145. chr["Left Leg"].Velocity = Vector3.new(0,3,0)
  146.  
  147. if chr.Humanoid.Health < 1 then
  148. LeftHandRedParent.Position = UDim2.new(99, 0, 0.3, 0)
  149. RightHandBlueParent.Position = UDim2.new(99, 0, 0.3, 0)
  150. end
  151.  
  152. --sit
  153.  
  154. if chr.Humanoid.Sit == true then
  155. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg1.WorldCFrame, 0.7)
  156. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg1.WorldCFrame, 0.65)
  157. end
  158.  
  159. if chr.Humanoid.Sit == false then
  160.  
  161. --idle
  162.  
  163. if chr.Torso.Velocity.Magnitude < 4 then
  164. if chr.Torso.Velocity.Y < 4 then
  165. if chr.Torso.Velocity.Y > -4 then
  166. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg0.WorldCFrame, 0.7)
  167. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg0.WorldCFrame, 0.65)
  168. end
  169. end
  170. end
  171.  
  172. --air
  173.  
  174. if chr.Torso.Velocity.Y > 4 then
  175. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg1.WorldCFrame, 0.7)
  176. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg1.WorldCFrame, 0.65)
  177. end
  178. if chr.Torso.Velocity.Y < -4 then
  179. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg1.WorldCFrame, 0.7)
  180. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg1.WorldCFrame, 0.65)
  181. end
  182.  
  183. --walking
  184.  
  185. if chr.Torso.Velocity.Magnitude > 4 then
  186. if chr.Torso.Velocity.Y < 4 then
  187. if chr.Torso.Velocity.Y > -4 then
  188.  
  189. if LegsPart == 0 then
  190. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg1.WorldCFrame, 0.35)
  191. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg2.WorldCFrame, 0.35)
  192. wait(0.15)
  193. LegsPart = 1
  194. end
  195.  
  196. if LegsPart == 1 then
  197. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg2.WorldCFrame, 0.35)
  198. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg3.WorldCFrame, 0.35)
  199. wait(0.15)
  200. LegsPart = 2
  201. end
  202.  
  203. if LegsPart == 2 then
  204. chr["Right Leg"].CFrame = chr["Right Leg"].CFrame:Lerp(RightLeg3.WorldCFrame, 0.36)
  205. chr["Left Leg"].CFrame = chr["Left Leg"].CFrame:Lerp(LeftLeg1.WorldCFrame, 0.35)
  206. wait(0.15)
  207. LegsPart = 0
  208. end
  209. end
  210. end
  211. end
  212. end
  213.  
  214. wait(0.5)
  215.  
  216. end)
Advertisement
Add Comment
Please, Sign In to add comment