Advertisement
idkwhatiam

LANCER

Jun 1st, 2019
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.41 KB | None | 0 0
  1. --LANCER SCRIPT BY YOUNGMACKA123.--
  2.  
  3.  
  4. --We already have jevil, how about we have lancer?--
  5.  
  6. plr = owner
  7. char = plr.Character
  8. Character = char
  9. anim = char.Animate
  10. anim:Destroy()
  11. torso = char.Torso
  12. lefta = char["Left Arm"]
  13. righta = char["Right Arm"]
  14. leftl = char["Left Leg"]
  15. rightl = char["Right Leg"]
  16. Root=Character["HumanoidRootPart"]
  17. position = nil
  18. LeftArm=Character["Left Arm"]
  19. LeftLeg=Character["Left Leg"]
  20. RightArm=Character["Right Arm"]
  21. RightLeg=Character["Right Leg"]
  22. Root=Character["HumanoidRootPart"]
  23. Head=Character["Head"]
  24. Torso=Character["Torso"]
  25. Neck=Torso["Neck"]
  26. walking = false
  27. jumping = false
  28. attacking = false
  29. firsttime = false
  30. tauntdebounce = false
  31. position = nil
  32. MseGuide = true
  33. running = false
  34. settime = 0
  35. sine = 0
  36. t = 0
  37. ws = 14
  38. change = 1
  39. combo1 = true
  40. dancing = false
  41. equip = false
  42. dgs = 75
  43. combo2 = false
  44. switch1 = true
  45. switch2 = false
  46. firsttime2 = false
  47. combo3 = false
  48. RunSrv = game:GetService("RunService")
  49. removeuseless = game:GetService("Debris")
  50.  
  51. --CREATE LANCER CHARACTER--
  52.  
  53. facetxt = "rbxassetid://2842757463"
  54. chesttxt = "rbxassetid://3111279416"
  55.  
  56.  
  57. spawn(function()
  58.     while wait() do
  59.         Head.BrickColor = BrickColor.new("Institutional white")
  60.         RightArm.BrickColor = BrickColor.new("Institutional white")
  61.         LeftArm.BrickColor = BrickColor.new("Institutional white")
  62.         Torso.BrickColor = BrickColor.new("Black")
  63.         RightLeg.BrickColor = BrickColor.new("Institutional white")
  64.         LeftLeg.BrickColor = BrickColor.new("Institutional white")
  65.         Head.face.Texture = facetxt
  66.         local Chestplate
  67.         Chestplate = Instance.new("Decal")
  68.         Chestplate.Parent = Torso
  69.         Chestplate.Texture = chesttxt
  70.         Chestplate.Face = "Front"
  71.     end
  72. end)
  73. for i,v in pairs(Character:children()) do
  74.     if v:IsA("Hat") then
  75.         v:Destroy()
  76.     end
  77. end
  78. for i,v in pairs(Character:children()) do
  79.     if v:IsA("Accessory") then
  80.         v:Destroy()
  81.     end
  82. end
  83. for i,v in pairs(Character:children()) do
  84.     if v:IsA("Hair") then
  85.         v:Destroy()
  86.     end
  87. end
  88. for i,v in pairs(Character:children()) do
  89.     if v:IsA("Shirt") then
  90.         v:Destroy()
  91.     end
  92. end
  93. for i,v in pairs(Character:children()) do
  94.     if v:IsA("Pants") then
  95.         v:Destroy()
  96.     end
  97. end
  98. for i,v in pairs(Character:children()) do
  99.     if v:IsA("Graphic Shirt") then
  100.         v:Destroy()
  101.     end
  102. end
  103. for i,v in pairs(Character:children()) do
  104.     if v:IsA("GraphicShirt") then
  105.         v:Destroy()
  106.     end
  107. end
  108.  
  109. for _,v in pairs(Character:children()) do
  110. if v:IsA("Shirt") then
  111. v.ShirtTemplate = "rbxassetid://0"
  112. elseif v:IsA("Pants") then
  113. v.PantsTemplate = "rbxassetid://0"
  114. elseif v:IsA("ShirtGraphic") then
  115. v:Remove()
  116. wait(.1)
  117. Torso.roblox:Remove()
  118. elseif v:IsA("Accessory") then
  119. v:Remove()
  120. end
  121. end
  122.  
  123. block1 = Instance.new("Part")
  124. block1.Parent = LeftArm
  125. block1.BrickColor = BrickColor.new("Bright blue")
  126. block1.CanCollide = false
  127. block1.Transparency = 0
  128. block1.Size = Vector3.new(1.1, 1, 1.1)
  129. block1.TopSurface = "Smooth"
  130. block1.BottomSurface = "Smooth"
  131. wblock1 = Instance.new("Weld")
  132. wblock1.Parent = block1
  133. wblock1.Part0 = block1
  134. wblock1.Part1 = LeftArm
  135. wblock1.C0 = CFrame.new(0, 0.51, 0)
  136.  
  137. block2 = Instance.new("Part")
  138. block2.Parent = RightArm
  139. block2.BrickColor = BrickColor.new("Bright blue")
  140. block2.CanCollide = false
  141. block2.Transparency = 0
  142. block2.Size = Vector3.new(1.1, 1, 1.1)
  143. block2.TopSurface = "Smooth"
  144. block2.BottomSurface = "Smooth"
  145. wblock2 = Instance.new("Weld")
  146. wblock2.Parent = block2
  147. wblock2.Part0 = block2
  148. wblock2.Part1 = RightArm
  149. wblock2.C0 = CFrame.new(0, 0.51, 0)
  150.  
  151. block3 = Instance.new("Part")
  152. block3.Parent = LeftLeg
  153. block3.BrickColor = BrickColor.new("Bright blue")
  154. block3.CanCollide = false
  155. block3.Transparency = 0
  156. block3.Size = Vector3.new(1.1, 1, 1.1)
  157. block3.TopSurface = "Smooth"
  158. block3.BottomSurface = "Smooth"
  159. wblock3 = Instance.new("Weld")
  160. wblock3.Parent = block3
  161. wblock3.Part0 = block3
  162. wblock3.Part1 = LeftLeg
  163. wblock3.C0 = CFrame.new(0, 0.51, 0)
  164.  
  165. block4 = Instance.new("Part")
  166. block4.Parent = RightLeg
  167. block4.BrickColor = BrickColor.new("Bright blue")
  168. block4.CanCollide = false
  169. block4.Transparency = 0
  170. block4.Size = Vector3.new(1.1, 1, 1.1)
  171. block4.TopSurface = "Smooth"
  172. block4.BottomSurface = "Smooth"
  173. wblock4 = Instance.new("Weld")
  174. wblock4.Parent = block4
  175. wblock4.Part0 = block4
  176. wblock4.Part1 = RightLeg
  177. wblock4.C0 = CFrame.new(0, 0.51, 0)
  178.  
  179. hat = Instance.new("Part")
  180. hat.Parent = Head
  181. hat.CanCollide = false
  182. hat.Size = Vector3.new(0.1, 0.1, 0.1)
  183. hat.BrickColor = BrickColor.new("Bright blue")
  184. mhat = Instance.new("SpecialMesh")
  185. mhat.Parent = hat
  186. mhat.MeshId = "rbxassetid://54924800"
  187. mhat.Scale = Vector3.new(1.2, 1, 1.2)
  188. what = Instance.new("Weld")
  189. what.Parent = hat
  190. what.Part0 = hat
  191. what.Part1 = Head
  192. what.C0 = CFrame.new(0, -0.43, -0.6)
  193.  
  194. --SMOOTH WAIT--
  195.  
  196. local HEADLERP = Instance.new("ManualWeld")
  197. HEADLERP.Parent = Head
  198. HEADLERP.Part0 = Head
  199. HEADLERP.Part1 = Head
  200. HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  201.  
  202. local TORSOLERP = Instance.new("ManualWeld")
  203. TORSOLERP.Parent = Root
  204. TORSOLERP.Part0 = Torso
  205. TORSOLERP.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  206.  
  207. local ROOTLERP = Instance.new("ManualWeld")
  208. ROOTLERP.Parent = Root
  209. ROOTLERP.Part0 = Root
  210. ROOTLERP.Part1 = Torso
  211. ROOTLERP.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  212.  
  213. local RIGHTARMLERP = Instance.new("ManualWeld")
  214. RIGHTARMLERP.Parent = RightArm
  215. RIGHTARMLERP.Part0 = RightArm
  216. RIGHTARMLERP.Part1 = Torso
  217. RIGHTARMLERP.C0 = CFrame.new(-1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  218.  
  219. local LEFTARMLERP = Instance.new("ManualWeld")
  220. LEFTARMLERP.Parent = LeftArm
  221. LEFTARMLERP.Part0 = LeftArm
  222. LEFTARMLERP.Part1 = Torso
  223. LEFTARMLERP.C0 = CFrame.new(1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  224.  
  225. local RIGHTLEGLERP = Instance.new("ManualWeld")
  226. RIGHTLEGLERP.Parent = RightLeg
  227. RIGHTLEGLERP.Part0 = RightLeg
  228. RIGHTLEGLERP.Part1 = Torso
  229. RIGHTLEGLERP.C0 = CFrame.new(-0.5, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  230.  
  231. local LEFTLEGLERP = Instance.new("ManualWeld")
  232. LEFTLEGLERP.Parent = LeftLeg
  233. LEFTLEGLERP.Part0 = LeftLeg
  234. LEFTLEGLERP.Part1 = Torso
  235. LEFTLEGLERP.C0 = CFrame.new(0.5, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  236.  
  237. local function weldBetween(a, b)
  238.     local weld = Instance.new("ManualWeld", a)
  239.     weld.Part0 = a
  240.     weld.Part1 = b
  241.     weld.C0 = a.CFrame:inverse() * b.CFrame
  242.     return weld
  243. end
  244.  
  245.  
  246. function ray(pos, dir, rang, ignoredesc)
  247.     return workspace:FindPartOnRay(Ray.new(pos, dir.unit * rang), ignoredesc)
  248. end
  249.  
  250. function swait(num)
  251.     if num == 0 or num == nil then
  252.         game:service("RunService").Stepped:wait(0)
  253.     else
  254.         for i = 0, num do
  255.             game:service("RunService").Stepped:wait(0)
  256.         end
  257.     end
  258. end
  259.  
  260. hf = ray(Root.Position,(CFrame.new(Root.Position,Root.Position+Vector3.new(0,-1,0))).lookVector,3*3,Character)
  261.  
  262. --ANIMATIONS--
  263.  
  264. checks1 = coroutine.wrap(function()
  265. while true do
  266. hf = ray(Root.Position,(CFrame.new(Root.Position,Root.Position+Vector3.new(0,-1,0))).lookVector,3*3,Character)
  267. if Root.Velocity.y > 1 then
  268. position = "Jump"
  269. elseif Root.Velocity.y < -1 then
  270. position = "Falling"
  271. elseif Root.Velocity.Magnitude < 2 then
  272. position = "Idle"
  273. elseif Root.Velocity.Magnitude > 2 then
  274. position = "Walking"
  275. elseif Root.Velocity.Magnitude > 20 then
  276. position = "Running"
  277. else
  278. end
  279. wait()
  280. end
  281. end)
  282. checks1()
  283.  
  284. local anims = coroutine.wrap(function()
  285. while true do
  286. settime = 0.05
  287. sine = sine + change
  288. if position == "Jump" and attacking == false then
  289. change = 1
  290. spin = false
  291. for i,v in pairs(Torso:GetChildren()) do if v:IsA("Sound") then v:Remove() end end
  292. LEFTLEGLERP.C1 = LEFTLEGLERP.C1:lerp(CFrame.new(0,0,0) * CFrame.Angles(0,0,0),.1)
  293. RIGHTLEGLERP.C1 = RIGHTLEGLERP.C1:lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),.1)
  294. LEFTARMLERP.C1 = LEFTARMLERP.C1:lerp(CFrame.new(0,0,0) * CFrame.Angles(0,0,0),.4)
  295. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), 0.2)
  296. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.4,.1,-.2) * CFrame.Angles(math.rad(20),math.rad(-3),math.rad(-4)), 0.2)
  297. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 2, 0) * CFrame.Angles(math.rad(10), math.rad(0), math.rad(0)), 0.2)
  298. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.5, 1.0, .9) * CFrame.Angles(math.rad(20), math.rad(0), math.rad(0)), 0.2)
  299. elseif position == "Falling" and attacking == false then
  300. change = 1
  301. spin = false
  302. for i,v in pairs(Torso:GetChildren()) do if v:IsA("Sound") then v:Remove() end end
  303. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(15), math.rad(0), math.rad(0)), 0.15)
  304. LEFTLEGLERP.C1 = LEFTLEGLERP.C1:lerp(CFrame.new(0,0,0) * CFrame.Angles(0,0,0),.1)
  305. RIGHTLEGLERP.C1 = RIGHTLEGLERP.C1:lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),.1)
  306. LEFTARMLERP.C1 = LEFTARMLERP.C1:lerp(CFrame.new(0,0,0) * CFrame.Angles(0,0,0),.4)
  307. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 2, 0) * CFrame.Angles(math.rad(8), math.rad(4), math.rad(0)), 0.2)
  308. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.5, 2, 0) * CFrame.Angles(math.rad(8), math.rad(-4), math.rad(0)), 0.2)
  309. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.5,.94 + .02 * math.sin(sine/12),-0) * CFrame.Angles(math.rad(28 + 5 * math.sin(sine/12)),math.rad(0),math.rad(45)), 0.2)
  310. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.5,.94 + .02 * math.sin(sine/12),-0) * CFrame.Angles(math.rad(28 + 5 * math.sin(sine/12)),math.rad(0),math.rad(-45)), 0.2)
  311. elseif position == "Walking" and attacking == false and running == false then
  312. change = 1.2
  313. walking = true
  314. spin = false
  315. for i,v in pairs(Torso:GetChildren()) do if v:IsA("Sound") then v:Remove() end end
  316. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.5 + Root.RotVelocity.Y / 85,.35,-.5*math.sin(sine/11)) * CFrame.Angles(math.rad(35*math.sin(sine/11)),math.rad(0*math.sin(sine/11)),math.rad(-10 + Root.RotVelocity.Y / 10, math.sin(-20 * math.sin(sine/4)))),.3)
  317. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.5 + Root.RotVelocity.Y / 85,.45,.5*math.sin(sine/11)) * CFrame.Angles(math.rad(-55*math.sin(sine/11)),math.rad(-5*math.sin(sine/8)),math.rad(10 + Root.RotVelocity.Y / 10, math.sin(20 * math.sin(sine/4)))),.3)
  318. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, -.15 * 0.6*-math.sin(sine/5.5), 0) * CFrame.Angles(math.rad(10), math.rad(12 * -math.sin(sine/11)), math.rad(0) + Root.RotVelocity.Y / 30, math.cos(25 * math.cos(sine/10))), 0.3)
  319. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 1.92 - 0.35 * math.cos(sine/11)/2.8, -0.1  + 0.1 - math.sin(sine/11)/3.4) * CFrame.Angles(math.rad(25 - 25) + -math.sin(sine/11)/2.3, math.rad(0)*math.cos(sine/1), math.rad(0), math.cos(-15 * 25 * math.cos(sine/11))), 0.3)
  320. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.5, 1.92 + 0.35 * math.cos(sine/11)/2.8, -0.1 + 0.1 + math.sin(sine/11)/3.4) * CFrame.Angles(math.rad(25 - 25) - -math.sin(sine/11)/2.3, math.rad(0)*math.cos(sine/1), math.rad(0) , math.cos(-15 * 25 * math.cos(sine/11))), 0.3)
  321. elseif position == "Idle" and attacking == false and running == false then
  322. change = .5
  323. spin = true
  324. for i,v in pairs(Torso:GetChildren()) do if v:IsA("Sound") then v:Remove() end end
  325. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, 0 * math.sin(sine/12), 0) * CFrame.Angles(math.rad(0 * -math.sin(sine/12)),math.rad(0),math.rad(0)),.1)
  326. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.5,.27 + .02 * math.sin(sine/12),.20 * -math.sin(sine/12)) * CFrame.Angles(math.rad(20 * math.sin(sine/12)),math.rad(0),math.rad(10)), 0.1)
  327. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.25,-.32 + 0 * math.sin(sine/12),0 * -math.sin(sine/12)) * CFrame.Angles(math.rad(0 * math.sin(sine/12)),math.rad(0),math.rad(20)), 0.1)
  328. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.3, 2 - .1 * math.sin(sine/12), 0) * CFrame.Angles(math.rad(6 * -math.sin(sine/12)), math.rad(0), math.rad(-10)), 0.1)
  329. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.3, 2.0 - .1 * math.sin(sine/12), 0) * CFrame.Angles(math.rad(6 * -math.sin(sine/12)), math.rad(0), math.rad(10)), 0.1)
  330. elseif position == "Running" and attacking == false then
  331. change = 1
  332. for i,v in pairs(Torso:GetChildren()) do if v:IsA("Sound") then v:Remove() end end
  333. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(0, .5, 0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), 0.3)
  334. LEFTARMLERP.C1 = LEFTARMLERP.C1:lerp(CFrame.new(-1.24+.6*math.sin(sine/4)/1.4, 0.54, 0-0.8*math.sin(sine/4))*CFrame.Angles(math.rad(6+140*math.sin(sine/4)/1.2), math.rad(0), math.rad(20+70*math.sin(sine/4))), 0.3)
  335. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(0,.5,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  336. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, -.2, 0) * CFrame.Angles(math.rad(-20 - 0 * math.sin(sine/4)), math.rad(0 + 6 * math.sin(sine/4)), math.rad(0) + Root.RotVelocity.Y / 30, math.sin(10 * math.sin(sine/4))), 0.3)
  337. RIGHTLEGLERP.C1 = RIGHTLEGLERP.C1:lerp(CFrame.new(0,0,-.2 + .5*-math.sin(sine/4)),.3)
  338. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 1.6+0.1*math.sin(sine/4),.7*-math.sin(sine/4)) * CFrame.Angles(math.rad(15+ -50 * math.sin(sine/4)),0,0),.3)
  339. LEFTLEGLERP.C1 = LEFTLEGLERP.C1:lerp(CFrame.new(0,0,-.2 + .5*math.sin(sine/4)),.3)
  340. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.5, 1.6-0.1*math.sin(sine/4),.7*math.sin(sine/4)) * CFrame.Angles(math.rad(15 + 50 * math.sin(sine/4)),0,0),.3)
  341. end
  342. swait()
  343. end
  344. end)
  345. anims()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement