Advertisement
TheUnknownDiscord

getting over it

Dec 14th, 2022 (edited)
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.28 KB | None | 0 0
  1. s = Instance.new("Sound")
  2. s.PlayOnRemove = true
  3. s.SoundId = "rbxassetid://9118631941"
  4. local part = Instance.new("Part",script)
  5. part.CFrame = owner.Character.Head.CFrame
  6. part.Size = Vector3.new(1.5,1.5,1.5) * 1.8
  7. local part3 = Instance.new("Part",script)
  8. part3.CFrame = owner.Character.Head.CFrame
  9. part3.Size = Vector3.new(0.5,0.5,0.5)
  10. part3.CanCollide = false
  11. local decal = Instance.new("Decal", part3)
  12. decal.Face = Enum.NormalId.Front
  13. decal.Texture = owner.Character.Head.face.Texture
  14. local part2 = Instance.new("Part",script)
  15. part2.CFrame = owner.Character.Head.CFrame
  16. part2.Size = Vector3.new(2,2,2)
  17. part2.Shape = "Ball"
  18. part3.Color = owner.Character.Head.Color
  19. part.Color = owner.Character.Torso.Color
  20. part:SetNetworkOwner(owner)
  21. part2:SetNetworkOwner(owner)
  22. local m = Instance.new("SpecialMesh",part2)
  23. m.MeshId = "rbxassetid://10604848"
  24. m.TextureId = "rbxassetid://10605252"
  25. m.Scale = Vector3.new(0.65,0.65,0.65)
  26. m.Offset = Vector3.new(0,-4,0)
  27. local object = Instance.new("ObjectValue", owner.PlayerGui)
  28. object.Value = part
  29. object.Name = "part"
  30. local object = Instance.new("ObjectValue", owner.PlayerGui)
  31. object.Value = part2
  32. object.Name = "part2"
  33. local object = Instance.new("ObjectValue", owner.PlayerGui)
  34. object.Value = part3
  35. object.Name = "part3"
  36. e = Instance.new("RemoteEvent",owner.PlayerGui)
  37. e.OnServerEvent:Connect(function(_,force)
  38. if force > 1 then
  39. s.Pitch = 1 + math.random(-30,30)/200
  40. s.Volume = 0.8 + (force * 0.1)
  41. s.Parent = part2
  42. s.Parent = nil
  43. end
  44. end)
  45. local rightup = Instance.new("Part",script)
  46. rightup.CFrame = owner.Character.Head.CFrame * CFrame.new(1,7.5,0)
  47. rightup.Size = ((Vector3.new(0.234 * 0.75, 0.331,0.226 * 0.75) * 8) - Vector3.new(0,0.5,0)) * 0.75
  48. rightup.Color = owner.Character["Right Arm"].Color
  49. local righth = Instance.new("Part",script)
  50. righth.CFrame = owner.Character.Head.CFrame * CFrame.new(1,7.5,0)
  51. righth.Size = Vector3.new(0.75,0.75,0.75)
  52. righth.Shape = "Ball"
  53. righth.CanCollide = false
  54. righth.Material = "SmoothPlastic"
  55. righth.Color = owner.Character["Right Arm"].Color
  56. local lefth = Instance.new("Part",script)
  57. lefth.CFrame = owner.Character.Head.CFrame * CFrame.new(1,7.5,0)
  58. lefth.Size = Vector3.new(0.75,0.75,0.75)
  59. lefth.Shape = "Ball"
  60. lefth.CanCollide = false
  61. lefth.Material = "SmoothPlastic"
  62. lefth.Color = owner.Character["Left Arm"].Color
  63. local rightdown = Instance.new("Part",script)
  64. rightdown.CFrame = owner.Character.Head.CFrame * CFrame.new(1.25,5,0.125)
  65. rightdown.Size = ((Vector3.new(0.234 * 0.65, 0.461,0.226 * 0.65) * 8) - Vector3.new(0,0.5,0)) * 0.75
  66. rightdown.Color = owner.Character["Right Arm"].Color
  67. local leftup = Instance.new("Part",script)
  68. leftup.CFrame = owner.Character.Head.CFrame * CFrame.new(1,7.5,0)
  69. leftup.Size = ((Vector3.new(0.234 * 0.75, 0.331,0.226 * 0.75) * 8) - Vector3.new(0,0.5,0)) * 0.75
  70. leftup.Color = owner.Character["Left Arm"].Color
  71. local leftdown = Instance.new("Part",script)
  72. leftdown.CFrame = owner.Character.Head.CFrame * CFrame.new(1.25,5,0.125)
  73. leftdown.Size = ((Vector3.new(0.234 * 0.65, 0.461,0.226 * 0.65) * 8) - Vector3.new(0,0.5,0)) * 0.75
  74. leftdown.Color = owner.Character["Left Arm"].Color
  75. local w = Instance.new("Weld",rightdown)
  76. w.Part0 = righth
  77. w.Part1 = rightdown
  78. w.C1 = CFrame.new(0.1,-(rightdown.Size.Y * 0.75),0)
  79. local w = Instance.new("Weld",leftdown)
  80. w.Part0 = lefth
  81. w.Part1 = leftdown
  82. w.C1 = CFrame.new(-0.1,-(leftdown.Size.Y * 0.75),0)
  83. local m = Instance.new("SpecialMesh",leftup)
  84. m.MeshId = "rbxassetid://2337186767"
  85. m.Scale = Vector3.new(3,3,3) * 0.75
  86. m.Offset = Vector3.new(0.5,0,0) * 0.75
  87. local m = Instance.new("SpecialMesh",part)
  88. m.MeshId = "rbxassetid://2337186836"
  89. m.Scale = Vector3.new(2.5,2.5,2.5) * 0.75
  90. local m = Instance.new("SpecialMesh",part3)
  91. m.MeshId = "rbxassetid://2337186646"
  92. m.Scale = Vector3.new(2.5,2.5,2.5) * 0.75
  93. local m = Instance.new("SpecialMesh",leftdown)
  94. m.MeshId = "rbxassetid://2337186757"
  95. m.Scale = Vector3.new(3,3,3) * 0.75
  96. local m = Instance.new("SpecialMesh",rightup)
  97. m.MeshId = "rbxassetid://2337186817"
  98. m.Scale = Vector3.new(3,3,3) * 0.75
  99. m.Offset = Vector3.new(-0.5,0,0) * 0.75
  100. local m = Instance.new("SpecialMesh",rightdown)
  101. m.MeshId = "rbxassetid://2337186800"
  102. m.Scale = Vector3.new(3,3,3) * 0.75
  103. local nocol = Instance.new("NoCollisionConstraint",part)
  104. nocol.Part1 = part2
  105. nocol.Part0 = part
  106. leftdown.CanCollide = false
  107. leftup.CanCollide = false
  108. rightup.CanCollide = false
  109. rightdown.CanCollide = false
  110. local o = Instance.new("ObjectValue", owner.PlayerGui)
  111. o.Value = leftup
  112. o.Name = "lu"
  113. local o = Instance.new("ObjectValue", owner.PlayerGui)
  114. o.Value = leftdown
  115. o.Name = "ld"
  116. local o = Instance.new("ObjectValue", owner.PlayerGui)
  117. o.Value = rightup
  118. o.Name = "ru"
  119. local o = Instance.new("ObjectValue", owner.PlayerGui)
  120. o.Value = rightdown
  121. o.Name = "rd"
  122. local o = Instance.new("ObjectValue", owner.PlayerGui)
  123. o.Value = lefth
  124. o.Name = "lh"
  125. local o = Instance.new("ObjectValue", owner.PlayerGui)
  126. o.Value = righth
  127. o.Name = "rh"
  128. function float(wha)
  129. local bv = Instance.new("BodyVelocity",wha)
  130. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  131. bv.Velocity = Vector3.new()
  132. end
  133. float(leftup)
  134. float(leftdown)
  135. float(rightup)
  136. float(rightdown)
  137. float(part3)
  138. for i,v in pairs(script:GetDescendants()) do
  139. pcall(function()
  140. v:SetNetworkOwner(owner)
  141. end)
  142. end
  143. NLS([[
  144. workspace.CurrentCamera.CameraType = "Scriptable"
  145. e = script.Parent
  146. m = owner:GetMouse()
  147. local dist = 8
  148. local active = 0
  149. m.KeyDown:Connect(function(key)
  150. key = key:lower()
  151. if key == "q" then
  152. active = 1
  153. elseif key == "e" then
  154. active = -1
  155. end
  156. end)
  157. m.KeyUp:Connect(function(key)
  158. key = key:lower()
  159. if key == "q" or key == "e" then
  160. active = 0
  161. end
  162. end)
  163. coroutine.wrap(function()
  164. while task.wait() do
  165. if workspace.CurrentCamera.CameraType ~= "Scriptable" then
  166. if active == 1 then
  167. dist = math.clamp(dist + 0.2,6.5,8.5)
  168. elseif active == -1 then
  169. dist = math.clamp(dist - 0.2,6.5,8.5)
  170. end
  171. end
  172. end
  173. end)()
  174. local part = owner.PlayerGui.part.Value
  175. local part2 = owner.PlayerGui.part2.Value
  176. local part3 = owner.PlayerGui.part3.Value
  177. local hand1 = owner.PlayerGui.lh.Value
  178. local hand2 = owner.PlayerGui.rh.Value
  179. workspace.CurrentCamera.CameraSubject = part3
  180. local at0 = Instance.new("Attachment",part2)
  181. local at1 = Instance.new("Attachment",workspace.Terrain)
  182. local at2 = Instance.new("Attachment",workspace.Terrain)
  183. local at3 = Instance.new("Attachment",part)
  184. local align = Instance.new("AlignPosition",part)
  185. align.Attachment0 = at0
  186. align.Attachment1 = at1
  187. align.Responsiveness = 200
  188. local align2 = Instance.new("AlignOrientation",part)
  189. align2.Attachment0 = at0
  190. align2.Attachment1 = at1
  191. align2.RigidityEnabled = true
  192. local align3 = Instance.new("AlignOrientation",part)
  193. align3.Attachment0 = at3
  194. align3.Attachment1 = at2
  195. align3.RigidityEnabled = true
  196. at0.CFrame = CFrame.Angles(math.rad(90),0,0)
  197. function spring_movement(spring_constant, mass, displacement)
  198. local force = spring_constant * displacement
  199. local acceleration = force / mass
  200. return acceleration
  201. end
  202. local uis = game:GetService("UserInputService")
  203. local lastis = false
  204. function solveIK(originCF, targetPos, l1, l2)
  205. -- build intial values for solving
  206. local localized = originCF:pointToObjectSpace(targetPos)
  207. local localizedUnit = localized.unit
  208. local l3 = localized.magnitude
  209. local axis = Vector3.new(0,0,-1):Cross(localizedUnit)
  210. local angle = math.acos(-localizedUnit.Z)
  211. local planeCF = originCF * CFrame.fromAxisAngle(axis, angle)
  212.  
  213. -- case: point is to close, unreachable
  214. -- return: push back planeCF so the "hand" still reaches, angles fully compressed
  215. if l3 < math.max(l2, l1) - math.min(l2, l1) then
  216. return planeCF * CFrame.new(0, 0, math.max(l2, l1) - math.min(l2, l1) - l3), -math.pi/2, math.pi
  217.  
  218. -- case: point is to far, unreachable
  219. -- return: for forward planeCF so the "hand" still reaches, angles fully extended
  220. elseif l3 > l1 + l2 then
  221. return planeCF * CFrame.new(0, 0, math.clamp(l1 + l2 - l3,0,0.01)), math.pi/2, 0
  222.  
  223. -- case: point is reachable
  224. -- return: planeCF is fine, solve the angles of the triangle
  225. else
  226. local a1 = -math.acos((-(l2 * l2) + (l1 * l1) + (l3 * l3)) / (2 * l1 * l3))
  227. local a2 = math.acos(((l2 * l2) - (l1 * l1) + (l3 * l3)) / (2 * l2 * l3))
  228.  
  229. return planeCF, a1 + math.pi/2, a2 - a1
  230. end
  231. end
  232. local leftup = owner.PlayerGui.lu.Value
  233. local leftdown = owner.PlayerGui.ld.Value
  234. local rightup = owner.PlayerGui.ru.Value
  235. local rightdown = owner.PlayerGui.rd.Value
  236. local VECTOR3_UP = Vector3.new(0, 1, 0)
  237. part2.Transparency = 0.6
  238. part3.Transparency = 0.6
  239. part.Transparency = 0.6
  240. hand2.Transparency = 0.6
  241. hand1.Transparency = 0.6
  242. leftup.Transparency = 0.6
  243. rightup.Transparency = 0.6
  244. rightdown.Transparency = 0.6
  245. leftdown.Transparency = 0.6
  246. part2.Material = "ForceField"
  247. local blur = Instance.new("BlurEffect",game:GetService("Lighting"))
  248. dist = 4
  249. workspace.CurrentCamera.CFrame = part.CFrame * CFrame.new(0,12,7)
  250. local bv = Instance.new("BodyVelocity",part)
  251. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  252. bv.Velocity = Vector3.new()
  253. coroutine.wrap(function()
  254. workspace.CurrentCamera.CFrame = part.CFrame * CFrame.new(0,12,7)
  255. workspace.CurrentCamera.FieldOfView = 40
  256. blur.Size = 15
  257. wait(1)
  258. local tweenService = game:GetService("TweenService")
  259. local timeToFade = 2
  260. local object = workspace.CurrentCamera
  261. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
  262. local goal = {}
  263. goal.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,-10,0)
  264. goal.FieldOfView = 70
  265. local camt = tweenService:Create(object, tweenInfo, goal)
  266. camt:Play()
  267. local tweenService = game:GetService("TweenService")
  268. local timeToFade = 1
  269. local object = blur
  270. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
  271. local goal = {}
  272. goal.Size = 0
  273. local camt2 = tweenService:Create(object, tweenInfo, goal)
  274. camt2:Play()
  275. camt.Completed:Wait()
  276. blur:Destroy()
  277. for i = 1,10 do
  278. dist = dist + (2/10)
  279. task.wait()
  280. end
  281. wait(1)
  282. workspace.CurrentCamera.CameraType = "Custom"
  283. bv.MaxForce = Vector3.new(0,part:GetMass() * 0.1,0)
  284. local bv = Instance.new("BodyVelocity",part2)
  285. bv.MaxForce = Vector3.new(0,part2:GetMass() * 0.1,0)
  286. bv.Velocity = Vector3.new()
  287. end)()
  288. coroutine.wrap(function()
  289. while task.wait() do
  290. if part.Velocity.Magnitude > 16 then
  291. workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position + part.Velocity * owner:GetNetworkPing()) * CFrame.Angles(workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ())
  292. workspace.CurrentCamera.FieldOfView = 70 + (part.Velocity.Magnitude * 0.1)
  293. else
  294. workspace.CurrentCamera.FieldOfView = 70
  295. end
  296. end
  297. end)()
  298. while game:GetService("RunService").RenderStepped:Wait() do
  299. local _,y,_ = workspace.CurrentCamera.CFrame:ToOrientation()
  300. at1.WorldCFrame = CFrame.new(part.Position) * CFrame.Angles(workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ()) * CFrame.new(0,0.125,-dist)
  301. part3.CFrame = (CFrame.new((part.CFrame * CFrame.new(0,1.75 * 0.75,0)).Position) * CFrame.Angles(workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ())) * CFrame.new(0,1 * 0.75,0)
  302. at2.WorldCFrame = CFrame.new(part.Position) * CFrame.Angles(0,y,0)
  303. coroutine.wrap(function()
  304. local goalPosition = (part2.CFrame * CFrame.new(0.1,-4,0.125)).Position
  305. local goalPosition2 = (part2.CFrame * CFrame.new(-0.1,-5.5,0.0625)).Position
  306. local upperV3 = VECTOR3_UP * leftup.Size
  307. local lowerV3 = VECTOR3_UP * leftdown.Size
  308. local upper2V3 = VECTOR3_UP * rightup.Size
  309. local lower2V3 = VECTOR3_UP * rightdown.Size
  310. local planeCF, shoulderAngle, elbowAngle = solveIK(part.CFrame * CFrame.new(-1.5 * 0.75,0.25,0), goalPosition, upperV3.Y, lowerV3.Y)
  311. local planeCF2, shoulderAngle2, elbowAngle2 = solveIK(part.CFrame * CFrame.new(1.5 * 0.75,0.25,0), goalPosition2, upper2V3.Y, lower2V3.Y)
  312. local shoulderAngleCFrame = CFrame.Angles(shoulderAngle, 0, 0)
  313. local elbowAngleAngleCFrame = CFrame.Angles(elbowAngle, 0, 0)
  314. local shoulderAngleCFrame2 = CFrame.Angles(shoulderAngle2, 0, 0)
  315. local elbowAngleAngleCFrame2 = CFrame.Angles(elbowAngle2, 0, 0)
  316. leftup.CFrame = planeCF * CFrame.new(-1.5 * 0.75,0.25,0) * shoulderAngleCFrame * CFrame.new(-upperV3 * 0.85)
  317. leftdown.CFrame = leftup.CFrame * CFrame.new(-lowerV3 * 0.5) * elbowAngleAngleCFrame * CFrame.new(-lowerV3 * 0.65)
  318. rightup.CFrame = planeCF2 * CFrame.new(1.5 * 0.75,0.25,0) * shoulderAngleCFrame2 * CFrame.new(-upper2V3 * 0.85)
  319. rightdown.CFrame = rightup.CFrame * CFrame.new(-lower2V3 * 0.5) * elbowAngleAngleCFrame2 * CFrame.new(-lower2V3 * 0.65)
  320. end)()
  321. if workspace.CurrentCamera.CameraType ~= "Scriptable" then
  322. local vel = math.clamp(spring_movement(150,part:GetMass() * 1.05,((at1.WorldPosition - part2.Position)).Magnitude),-30 * 3,30 * 3)
  323. vel = -vel
  324. local a = part2:GetTouchingParts()
  325. local is = false
  326. if #a > 0 then
  327. for i,v in pairs(a) do
  328. if v.CanCollide == true and v.Parent ~= part.Parent then
  329. is = true
  330. end
  331. end
  332. end
  333. if is and not lastis then
  334. e:FireServer(-vel * 0.5)
  335. lastis = true
  336. end
  337. if is == true then
  338. part.Velocity = part.Velocity * 0.7 + ((CFrame.Angles(CFrame.new(part2.Position,at1.WorldPosition):ToEulerAnglesXYZ()).lookVector * vel))
  339. part2.Velocity = part.Velocity
  340. part3.Velocity = part.Velocity * 2
  341. else
  342. if lastis then
  343. part.Velocity = part.Velocity * 0.7 + ((CFrame.Angles(CFrame.new(part2.Position,at1.WorldPosition):ToEulerAnglesXYZ()).lookVector * vel))
  344. part2.Velocity = part.Velocity
  345. part3.Velocity = part.Velocity * 2
  346. lastis = false
  347. end
  348. end
  349. end
  350. end
  351. ]],e)
  352. owner.Character.Parent = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement