Advertisement
WellSumo

Roblox Script Test

Jan 22nd, 2020
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.45 KB | None | 0 0
  1. wait(0.5)
  2.  
  3. local character = game.Players.LocalPlayer.Character
  4.  
  5. character.Humanoid.WalkSpeed = 25
  6. workspace.Gravity = 70--80--90
  7.  
  8. local ttw = 0.5
  9. local frame = 0
  10.  
  11.  
  12.  
  13. function getdirection (direction,orientation,typ)
  14. if typ == "Y" then
  15. local mover = CFrame.new(Vector3.new(0,0,0),direction)
  16. local x, y, z = mover:ToOrientation()
  17. local final = math.deg(y) - orientation.Y
  18. return final
  19. end
  20. end
  21.  
  22.  
  23.  
  24. --print((character.Humanoid.WalkSpeed/16)*0.5)
  25.  
  26. local rv = Instance.new("BoolValue",character)
  27. rv.Name = "RD"
  28. rv.Value = false
  29.  
  30.  
  31.  
  32. local children = character:GetChildren()
  33.  
  34. for c = 1,#children do
  35. local child = children[c]
  36. if child then
  37. if child.ClassName == "CharacterMesh" or child.ClassName == "Accessory" then
  38. child:Destroy()
  39. end
  40. end
  41. end
  42.  
  43. local leftlegA = Instance.new("Attachment",character["Left Leg"])
  44. leftlegA.Name = "LLA"
  45. leftlegA.Position = Vector3.new(0,1,0)
  46.  
  47. local leftlegB = Instance.new("Attachment",character.Torso)
  48. leftlegB.Name = "LLB"
  49. leftlegB.Position = Vector3.new(-0.5,-1,0)
  50.  
  51. local phylleg = Instance.new("BallSocketConstraint",character.Torso)
  52. phylleg.Name = "LegJoint"
  53. phylleg.Attachment0 = leftlegA
  54. phylleg.Attachment1 = leftlegB
  55.  
  56. character.Torso["Left Hip"].Part1 = nil
  57.  
  58.  
  59.  
  60. local rightlegA = Instance.new("Attachment",character["Right Leg"])
  61. rightlegA.Name = "LLA"
  62. rightlegA.Position = Vector3.new(0,1,0)
  63.  
  64. local rightlegB = Instance.new("Attachment",character.Torso)
  65. rightlegB.Name = "LLB"
  66. rightlegB.Position = Vector3.new(0.5,-1,0)
  67.  
  68. local phylleg = Instance.new("BallSocketConstraint",character.Torso)
  69. phylleg.Name = "LegJoint"
  70. phylleg.Attachment0 = rightlegA
  71. phylleg.Attachment1 = rightlegB
  72.  
  73. character.Torso["Right Hip"].Part1 = nil
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. local leftarmA = Instance.new("Attachment",character["Left Arm"])
  89. leftarmA.Name = "LLA"
  90. leftarmA.Position = Vector3.new(0,0.5,0)
  91.  
  92. local leftarmB = Instance.new("Attachment",character.Torso)
  93. leftarmB.Name = "LLB"
  94. leftarmB.Position = Vector3.new(-1.5,0.5,0)
  95.  
  96. local phylarm = Instance.new("BallSocketConstraint",character.Torso)
  97. phylarm.Name = "armJoint"
  98. phylarm.Attachment0 = leftarmA
  99. phylarm.Attachment1 = leftarmB
  100.  
  101. character.Torso["Left Shoulder"].Part1 = nil
  102.  
  103.  
  104.  
  105. local rightarmA = Instance.new("Attachment",character["Right Arm"])
  106. rightarmA.Name = "LLA"
  107. rightarmA.Position = Vector3.new(0,0.5,0)
  108.  
  109. local rightarmB = Instance.new("Attachment",character.Torso)
  110. rightarmB.Name = "LLB"
  111. rightarmB.Position = Vector3.new(1.5,0.5,0)
  112.  
  113. local phylarm = Instance.new("BallSocketConstraint",character.Torso)
  114. phylarm.Name = "armJoint"
  115. phylarm.Attachment0 = rightarmA
  116. phylarm.Attachment1 = rightarmB
  117.  
  118. character.Torso["Right Shoulder"].Part1 = nil
  119.  
  120.  
  121.  
  122. local llb = Instance.new("Part",character["Left Leg"])
  123. llb.Size = character["Left Leg"].Size
  124. llb.CFrame = character["Left Leg"].CFrame
  125. llb.Name = "Collision"
  126. llb.Transparency = 1
  127. local llbweld = Instance.new("WeldConstraint",llb)
  128. llbweld.Part0 = llb
  129. llbweld.Part1 = character["Left Leg"]
  130.  
  131. local rlb = Instance.new("Part",character["Right Leg"])
  132. rlb.Size = character["Right Leg"].Size
  133. rlb.CFrame = character["Right Leg"].CFrame
  134. rlb.Name = "Collision"
  135. rlb.Transparency = 1
  136. local rlbweld = Instance.new("WeldConstraint",rlb)
  137. rlbweld.Part0 = rlb
  138. rlbweld.Part1 = character["Right Leg"]
  139.  
  140.  
  141.  
  142.  
  143. local lab = Instance.new("Part",character["Left Arm"])
  144. lab.Size = character["Left Arm"].Size
  145. lab.CFrame = character["Left Arm"].CFrame
  146. lab.Name = "Collision"
  147. lab.Transparency = 1
  148. local labweld = Instance.new("WeldConstraint",lab)
  149. labweld.Part0 = lab
  150. labweld.Part1 = character["Left Arm"]
  151.  
  152. local rab = Instance.new("Part",character["Right Arm"])
  153. rab.Size = character["Right Arm"].Size
  154. rab.CFrame = character["Right Arm"].CFrame
  155. rab.Name = "Collision"
  156. rab.Transparency = 1
  157. local rabweld = Instance.new("WeldConstraint",rab)
  158. rabweld.Part0 = rab
  159. rabweld.Part1 = character["Right Arm"]
  160.  
  161. character.Humanoid.PlatformStand = true
  162.  
  163.  
  164.  
  165.  
  166. local nocll = Instance.new("NoCollisionConstraint",character["Left Leg"])
  167. nocll.Part0 = llb
  168. nocll.Part1 = character.Torso
  169. local nocrl = Instance.new("NoCollisionConstraint",character["Right Leg"])
  170. nocrl.Part0 = rlb
  171. nocrl.Part1 = character.Torso
  172.  
  173. local nocla = Instance.new("NoCollisionConstraint",character["Left Arm"])
  174. nocla.Part0 = lab
  175. nocla.Part1 = character.Torso
  176. local nocra = Instance.new("NoCollisionConstraint",character["Right Arm"])
  177. nocra.Part0 = rab
  178. nocra.Part1 = character.Torso
  179.  
  180. local lrl = Instance.new("NoCollisionConstraint",character.Torso)
  181. lrl.Part0 = rlb
  182. lrl.Part1 = llb
  183.  
  184. character.Humanoid.WalkSpeed = 20
  185.  
  186. local gy = Instance.new("BodyGyro",character.Torso)
  187. gy.MaxTorque = Vector3.new(40000000, 40000000, 40000000)
  188. gy.D = 50
  189. gy.P = 500
  190.  
  191.  
  192. local ll = Instance.new("Attachment",character.Torso)
  193. ll.Name = "LA"
  194. local rl = Instance.new("Attachment",character.Torso)
  195. rl.Name = "RA"
  196.  
  197. local llc = Instance.new("Attachment",character["Left Leg"])
  198. llc.Name = "LCA"
  199. local rlc = Instance.new("Attachment",character["Right Leg"])
  200. rlc.Name = "RCA"
  201.  
  202.  
  203. local lj = Instance.new("AlignOrientation",character["Left Leg"])
  204. lj.Name = "LO"
  205. lj.Attachment0 = llc
  206. lj.Attachment1 = ll
  207. lj.MaxTorque = 1000000000000000000
  208. lj.Responsiveness = 45
  209. local rj = Instance.new("AlignOrientation",character["Right Leg"])
  210. rj.Name = "RO"
  211. rj.Attachment0 = rlc
  212. rj.Attachment1 = rl
  213. rj.MaxTorque = 1000000000000000000
  214. rj.Responsiveness = 45
  215.  
  216.  
  217. local frame = 0
  218.  
  219.  
  220. local moveval = 0
  221.  
  222.  
  223. local vel = Instance.new("BodyVelocity",character.Torso)
  224. vel.MaxForce = Vector3.new(40000000,0,40000000)
  225.  
  226.  
  227. local force = Instance.new("BodyForce",character.HumanoidRootPart)
  228. force.Force = Vector3.new(0,0,0)
  229.  
  230.  
  231. function getmass ()
  232. local totalmass = 0
  233. local children = character:GetDescendants()
  234.  
  235. for dec = 1,#children do
  236. local child = children[dec]
  237. if string.match(child.ClassName , "Part") then
  238. totalmass = totalmass + child:GetMass()
  239. end
  240. end
  241.  
  242. return totalmass
  243. end
  244.  
  245. local derb = game:GetService("Debris")
  246.  
  247. local landed = true
  248.  
  249. local mv = true
  250.  
  251. game:GetService("RunService").RenderStepped:Connect(function()
  252. gy.CFrame = workspace.CurrentCamera.CFrame
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260. --ll.CFrame = CFrame.Angles(0,math.rad(-character.Torso.Orientation.Y),0) * character.Torso["Left Hip"].C0
  261. --rl.CFrame = CFrame.Angles(0,math.rad(-character.Torso.Orientation.Y),0) * character.Torso["Right Hip"].C0
  262.  
  263. local mass = getmass()
  264.  
  265. vel.Velocity = character.Humanoid.MoveDirection * character.Humanoid.WalkSpeed
  266.  
  267. force.Force = ((character.Humanoid.MoveDirection * character.Humanoid.WalkSpeed)*(mass))*moveval --25
  268.  
  269. if rv.Value == true or landed == false then
  270. rj.MaxTorque = 0
  271. lj.MaxTorque = 0
  272. gy.MaxTorque = Vector3.new(0,0,0)
  273. vel.MaxForce = Vector3.new(0,0,0)
  274. if mv == true then
  275. moveval = 1
  276. else
  277. moveval = 0
  278. end
  279. else
  280. rj.MaxTorque = 10000000000000000000
  281. lj.MaxTorque = 10000000000000000000
  282. gy.MaxTorque = Vector3.new(40000000, 40000000, 40000000)
  283. vel.MaxForce = Vector3.new(40000000,0,40000000)
  284. moveval = 0
  285. end
  286.  
  287.  
  288. if character.Humanoid.Health == 0 then
  289. script:Destroy()
  290. end
  291.  
  292. if math.abs(character.Humanoid.MoveDirection.Magnitude) ~= 0 then
  293.  
  294.  
  295. ttw = (1.1) - ((character.Humanoid.WalkSpeed*2)*(0.0625*0.35)) --0.65
  296.  
  297.  
  298. local direction = getdirection(character.Humanoid.MoveDirection , character.Torso.Orientation,"Y")
  299.  
  300. local dir = 0
  301.  
  302.  
  303. if frame == 0 then
  304. character.Torso.LA.CFrame = CFrame.Angles(math.rad(-character.Torso.Orientation.X),math.rad(--[[direction]]0),0) * CFrame.Angles(math.rad(40),0,0)-- * CFrame.Angles(0,math.rad(-direction)*dir,0)
  305. character.Torso.RA.CFrame = CFrame.Angles(math.rad(-character.Torso.Orientation.X),math.rad(--[[direction]]0),0) * CFrame.Angles(math.rad(-40),0,0)-- * CFrame.Angles(0,math.rad(-direction)*dir,0)
  306. elseif frame ~= 0 then
  307. character.Torso.LA.CFrame = CFrame.Angles(math.rad(-character.Torso.Orientation.X),math.rad(--[[direction]]0),0) * CFrame.Angles(math.rad(-40),0,0)-- * CFrame.Angles(0,math.rad(-direction)*dir,0)
  308. character.Torso.RA.CFrame = CFrame.Angles(math.rad(-character.Torso.Orientation.X),math.rad(--[[direction]]0),0) * CFrame.Angles(math.rad(40),0,0)-- * CFrame.Angles(0,math.rad(-direction)*dir,0)
  309. end
  310. else
  311. character.Torso.LA.CFrame = CFrame.Angles(math.rad(-character.Torso.Orientation.X),0,0)
  312. character.Torso.RA.CFrame = CFrame.Angles(math.rad(-character.Torso.Orientation.X),0,0)
  313. end
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320. local ray = Ray.new(character.Torso.Position , -Vector3.new(0,3.3,0))---Vector3.new(-character.Humanoid.MoveDirection.X*1.25,character.Hight.Value,-character.Humanoid.MoveDirection.Z*1.25)
  321. local h , pos = workspace:FindPartOnRay(ray , character , false , true)
  322. if h and h.Name ~= "Handle" then
  323. landed = true
  324. end
  325. if character.Humanoid.Jump == true then
  326. if (h and h.Name ~= "Handle" and h.CanCollide == true) or character:FindFirstChild("water") then
  327. landed = false
  328. local jump = Instance.new("BodyVelocity",character.Head)
  329.  
  330. if character:FindFirstChild("water") then
  331. jump.Velocity = Vector3.new(0,40--[[*0.6]],0)
  332. jump.MaxForce = Vector3.new(0,5000,0)
  333. else
  334. jump.Velocity = Vector3.new(0,40,0)
  335. jump.MaxForce = Vector3.new(0,9999999,0)
  336. end
  337.  
  338. jump.Name = "JMP"
  339. jump.P = 1250
  340. derb:AddItem(jump,0.1)
  341.  
  342.  
  343. --[[if character:FindFirstChild("water") then
  344. wait(2)
  345. end]]--
  346.  
  347.  
  348. landed = false
  349. wait(0.25)
  350. landed = false
  351. end
  352. end
  353. end)
  354.  
  355.  
  356. while wait(ttw) do
  357. if frame == 0 then
  358. frame = 1
  359. elseif frame ~= 0 then
  360. frame = 0
  361. end
  362. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement