subaru112g

Test

Apr 19th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.40 KB | None | 0 0
  1. warn("Made by Subaru112")
  2.  
  3. Mouse = game:GetService("Players").Subaru112:GetMouse()
  4.  
  5. local FlameThrower = Instance.new("Model",owner.Character)
  6. local doomwe = Instance.new("Part",FlameThrower)
  7. doomwe.Name = "DoomW"
  8. doomwe.Size = Vector3.new(1.474, 0.309, 0.48)
  9.  
  10. ArtificialHB = Instance.new("BindableEvent", script)
  11. ArtificialHB.Name = "Heartbeat"
  12. script:WaitForChild("Heartbeat")
  13. frame = 0.03333333333333
  14. tf = 0
  15. allowframeloss = false
  16. tossremainder = false
  17. lastframe = tick()
  18. script.Heartbeat:Fire()
  19. game:GetService("RunService").Heartbeat:connect(function(s, p)
  20. tf = tf + s
  21. if tf >= frame then
  22. if allowframeloss then
  23. script.Heartbeat:Fire()
  24. lastframe = tick()
  25. else
  26. for i = 1, math.floor(tf / frame) do
  27. script.Heartbeat:Fire()
  28. end
  29. lastframe = tick()
  30. end
  31. if tossremainder then
  32. tf = 0
  33. else
  34. tf = tf - frame * math.floor(tf / frame)
  35. end
  36. end
  37. end)
  38.  
  39. function swait(num)
  40. if num == 0 or num == nil then
  41. ArtificialHB.Event:wait()
  42. else
  43. for i = 0, num do
  44. ArtificialHB.Event:wait()
  45. end
  46. end
  47. end
  48.  
  49.  
  50. function rayCast(Position, Direction, Range, Ignore)
  51. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  52. end
  53.  
  54. local sine = 0
  55. local change = 1
  56.  
  57. function GetDudesTorso(c)
  58. local torsy = (c:findFirstChild("Torso") or c:findFirstChild("UpperTorso"))
  59. if torsy ~= nil then
  60. return torsy
  61. end
  62. end
  63.  
  64. local plr = game:GetService("Players").Subaru112
  65. local char = plr.Character
  66. local chara = plr.Character
  67. local RootPart = chara.HumanoidRootPart
  68. local RootJoint = RootPart.RootJoint
  69. local Create = LoadLibrary("RbxUtility").Create
  70. local debby = game:GetService("Debris")
  71.  
  72. local Humanoid = char:FindFirstChildOfClass("Humanoid")
  73.  
  74. local Torso,Head,LeftArm,RightArm,LeftLeg,RightLeg,Root = char.Torso,char.Head,char["Left Arm"],char["Right Arm"],char["Left Leg"],char["Right Leg"],char.HumanoidRootPart
  75.  
  76. local neck,RH,LH,rootj,RS,LS = Torso.Neck,Torso["Right Hip"],Torso["Left Hip"],Root.RootJoint,Torso["Right Shoulder"],Torso["Left Shoulder"]
  77.  
  78. local rootjn,neckn,RHn,LHn,LSn,RSn = rootj.C0,neck.C0,RH.C0,LH.C0,LS.C0,RS.C0
  79.  
  80. local mus = Instance.new("Sound",char)
  81. local timepos = nil
  82.  
  83. Humanoid.WalkSpeed = 16
  84. Humanoid.Animator.Parent = nil
  85. chara.Animate.Parent = nil
  86.  
  87. local attack = false
  88. local Anim = 'Idle'
  89. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  90. local velocity = RootPart.Velocity.y
  91.  
  92. local newMotor = function(part0, part1, c0, c1)
  93. local w = Create('Motor'){
  94. Parent = part0,
  95. Part0 = part0,
  96. Part1 = part1,
  97. C0 = c0,
  98. C1 = c1,
  99. }
  100. return w
  101. end
  102.  
  103. function clerp(a, b, t)
  104. return a:lerp(b, t)
  105. end
  106.  
  107. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  108. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  109.  
  110. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  111. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  112. local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
  113. local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
  114. local FT = newMotor(RightArm, FlameThrower.DoomW, CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997), CFrame.new(0, 0, 0))
  115. RootJoint.C1 = CFrame.new(0, 0, 0)
  116. RootJoint.C0 = CFrame.new(0, 0, 0)
  117. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  118. Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
  119.  
  120. local rarmc1 = RW.C1
  121. local larmc1 = LW.C1
  122. local rlegc1 = RH.C1
  123. local llegc1 = LH.C1
  124.  
  125. local resetc1 = false
  126.  
  127. function PlayAnimationFromTable(table, speed, bool)
  128. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  129. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  130. RW.C0 = clerp(RW.C0, table[3], speed)
  131. LW.C0 = clerp(LW.C0, table[4], speed)
  132. RH.C0 = clerp(RH.C0, table[5], speed)
  133. LH.C0 = clerp(LH.C0, table[6], speed)
  134. FT.C0 = clerp(FT.C0, table[7], speed)
  135. if bool == true then
  136. if resetc1 == false then
  137. resetc1 = true
  138. RootJoint.C1 = RootJoint.C1
  139. Torso.Neck.C1 = Torso.Neck.C1
  140. RW.C1 = rarmc1
  141. LW.C1 = larmc1
  142. RH.C1 = rlegc1
  143. LH.C1 = llegc1
  144. end
  145. end
  146. end
  147.  
  148. local debounce = true
  149.  
  150. local dmgg = FlameThrower.Damageg
  151. local dmgt = dmgg.DMG
  152.  
  153. function Dmg(dude)
  154. if dude and dude ~= chara and debounce == true then
  155. debounce = false
  156. local enemy = dude:FindFirstChildOfClass("Humanoid")
  157. local damage = math.random(1,10)
  158. enemy.Health = enemy.Health - damage
  159. if dude:FindFirstChild("Head") then
  160. dmgg.Enabled = true
  161. dmgg.Adornee = dude:FindFirstChild("Head")
  162. dmgt.Text = "-"..damage
  163. end
  164. local kill = math.random(1,60)
  165.  
  166.  
  167. if kill == 60 then
  168. if enemy then
  169. enemy:Destroy()
  170. end
  171. end
  172.  
  173. if enemy.Health <= 50 then
  174. for i,v in pairs(dude:GetChildren()) do
  175. if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  176. v.BrickColor = BrickColor.new("Really black")
  177. end
  178. if v.ClassName == "Shirt" or v.ClassName == "Pants" or v.ClassName == "Accessory" or v.ClassName == "Hat" then
  179. v:Destroy()
  180. end
  181. end
  182. end
  183.  
  184. if enemy.Health <= 10 then
  185. enemy.JumpPower = 80
  186. enemy.Jump = true
  187. end
  188. wait(0.3)
  189. debounce = true
  190. dmgg.Enabled = false
  191. dmgg.Adornee = nil
  192. end
  193. end
  194.  
  195. function MagnitudeDmg(par,magni)
  196. for _, c in pairs(workspace:GetDescendants()) do
  197. local hum = c:FindFirstChildOfClass("Humanoid")
  198. if hum ~= nil then
  199. local head = GetDudesTorso(c)
  200. if head ~= nil then
  201. local targ = head.Position - par.Position
  202. local mag = targ.magnitude
  203. if magni >= mag and c ~= chara then
  204. Dmg(c)
  205. end
  206. end
  207. end
  208. end
  209. end
  210.  
  211. hold = false
  212.  
  213. Mouse.Button1Down:connect(function()
  214. hold = true
  215. end)
  216.  
  217. Mouse.Button1Up:connect(function()
  218. hold = false
  219. end)
  220.  
  221. function shoot()
  222. attack = true
  223. Humanoid.WalkSpeed = 2
  224. attack = false
  225. end
  226.  
  227. function Flame()
  228. MagnitudeDmg(FlameThrower.End,3)
  229. end
  230.  
  231. while game:GetService("RunService").Heartbeat:Wait() do
  232. Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  233. velocity = RootPart.Velocity.y
  234. sine = sine + change
  235. local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, chara)
  236. if RootPart.Velocity.y > 1 and hit == nil then
  237. Anim = "Jump"
  238. if attack == false then
  239. PlayAnimationFromTable({
  240. CFrame.new(0, 0.0382082276, -0.0403150208, 1, 0, 0, 0, 0.984807849, 0.173647985, 0, -0.173647985, 0.984807849),
  241. CFrame.new(0, 1.46579528, 0.0939689279, 1, 0, 0, 0, 0.939692855, -0.342019796, 0, 0.342019796, 0.939692855),
  242. CFrame.new(1.20945489, -0.213504896, 3.55388607e-07, 0.939692736, 0.342019916, 1.53461215e-07, -0.342019945, 0.939692736, 1.93715096e-07, -8.56816769e-08, -2.23517418e-07, 1.00000012),
  243. CFrame.new(-1.20945573, -0.213503733, 5.0439985e-07, 0.939692736, -0.342019916, -1.53461215e-07, 0.342019945, 0.939692736, 1.93715096e-07, 8.56816769e-08, -2.23517418e-07, 1.00000012),
  244. CFrame.new(0.5, -1.99739456, -0.0180913229, 1, 0, 0, 0, 1.00000012, 0, 0, 0, 1.00000012),
  245. CFrame.new(-0.5, -1.30000103, -0.39999947, 1, 0, 0, 0, 0.939692676, 0.342020601, 0, -0.342020601, 0.939692676),
  246. CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997),
  247. }, .3, false)
  248. end
  249. elseif RootPart.Velocity.y < -1 and hit == nil then
  250. Anim = "Fall"
  251. if attack == false then
  252. PlayAnimationFromTable({
  253. CFrame.new(0, -0.0646628663, 0.0399149321, 1, 0, 0, 0, 0.984807849, -0.173647985, 0, 0.173647985, 0.984807849),
  254. CFrame.new(0, 1.4913609, -0.128171027, 1, 0, 0, 0, 0.939692855, 0.342019796, 0, -0.342019796, 0.939692855),
  255. CFrame.new(1.55285025, 0.466259956, -9.26282269e-08, 0.766043842, -0.642788351, -6.46188241e-08, 0.642788291, 0.766043961, -7.4505806e-08, 1.04308128e-07, 1.49011612e-08, 1.00000012),
  256. CFrame.new(-1.5605253, 0.475036323, -2.10609159e-07, 0.766043842, 0.642788351, 6.46188241e-08, -0.642788291, 0.766043961, -7.4505806e-08, -1.04308128e-07, 1.49011612e-08, 1.00000012),
  257. CFrame.new(0.500000954, -1.9973948, -0.0180922765, 1, 0, 0, 0, 1.00000012, 0, 0, 0, 1.00000012),
  258. CFrame.new(-0.499999046, -1.30000043, -0.400000483, 1, 0, 0, 0, 0.939692855, 0.342019796, 0, -0.342019796, 0.939692855),
  259. CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997),
  260. }, .3, false)
  261. end
  262. elseif Torsovelocity < 1 and hit ~= nil then
  263. Anim = "Idle"
  264. if attack == false then
  265. change = 1
  266. PlayAnimationFromTable({
  267. CFrame.new(-0.0769465268, -7.7815578e-08, -0.031559173, 0.939695537, 1.01607293e-06, 0.342021346, 7.9855522e-07, 1.00000191, 5.12654879e-07, -0.342019558, 2.16066837e-07, 0.939692855) * CFrame.new(0,.05 * math.cos((sine)/10), 0),
  268. CFrame.new(0.0615186803, 1.4999913, 0.0559706129, 0.939695537, 7.9855522e-07, -0.342019558, 1.01607293e-06, 1.00000191, 2.16066837e-07, 0.342021346, 5.12654879e-07, 0.939692855),
  269. CFrame.new(1.2267952, 0.283012867, -0.709815979, 0.866025388, 0.5, 0, -0.249999985, 0.433012664, -0.866025448, -0.433012724, 0.75, 0.49999997) * CFrame.new(0, 0, -.05 * math.cos((sine)/25)),
  270. CFrame.new(-1.12679291, 0.172679424, -0.727638245, 0.866025388, -0.5, 0, 0.321393758, 0.556670308, -0.766044497, 0.383022249, 0.663414001, 0.642787516) * CFrame.new(0, 0, -.05 * math.cos((sine)/25)),
  271. CFrame.new(0.5, -2, 0, 0.984807789, 0, -0.17364797, 0, 1, 0, 0.17364797, 0, 0.984807789) * CFrame.new(0,-.05 * math.cos((sine)/10), 0),
  272. CFrame.new(-0.5, -2, 0, 0.98480773, 0, 0.173648179, 0, 1, 0, -0.173648179, 0, 0.98480773) * CFrame.new(0,-.05 * math.cos((sine)/10), 0),
  273. CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997),
  274. }, .3, false)
  275. else
  276. Humanoid.WalkSpeed = 13
  277. PlayAnimationFromTable({
  278. CFrame.new(0, 0, 0, 0.342019528, 1.77958145e-06, -0.939692795, 3.40915449e-06, 1.00000191, -6.52960921e-07, 0.93969065, 2.98023178e-06, 0.342019796),
  279. CFrame.new(0, 1.50000906, 1.14440918e-05, 0.173647419, -2.75033563e-06, 0.984805226, 6.04339357e-06, 1.00000226, 1.03842858e-05, -0.984807909, 2.48085234e-06, 0.173647329),
  280. CFrame.new(1.00930023, 0.257047653, -0.754802704, 0.642785251, 0.766046405, 7.68762584e-06, -0.383019745, 0.321398407, -0.866024792, -0.663417637, 0.556665003, 0.500001073),
  281. CFrame.new(-1.0977478, 0.360425472, -0.348266602, 0.984804809, -0.173665076, 2.0735275e-05, 0.111646183, 0.63302201, -0.766040623, 0.133021384, 0.754402816, 0.642792106),
  282. CFrame.new(0.499977112, -1.96527863, 0.00304412842, -5.06639481e-07, -2.75193088e-06, 0.999997497, 4.16326839e-06, 1.00000226, 1.1278622e-05, -1, 2.49612867e-06, -1.07288361e-06),
  283. CFrame.new(-0.500015259, -1.96529007, 0.00304031372, -5.36441803e-07, -2.75543152e-06, 0.999997377, 4.16326839e-06, 1.00000226, 1.1278622e-05, -1, 2.49485447e-06, -1.10268593e-06),
  284. CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997),
  285. }, .3, false)
  286. end
  287. elseif Torsovelocity > 2 and hit ~= nil then
  288. Anim = "Walk"
  289. if attack == false then
  290. Humanoid.WalkSpeed = 25
  291. PlayAnimationFromTable({
  292. CFrame.new(0, 0, 0, 1, 9.17673447e-07, -8.02856235e-08, 8.89790499e-07, 0.984808445, 0.173649818, -2.38418238e-07, -0.173646539, 0.984807014) * CFrame.new(0, 0- .08 * math.cos((sine) / 2.5), 0) * CFrame.Angles(0, 0, 0),
  293. CFrame.new(0, 1.50000191, 1.52587891e-05, 1, 2.66937332e-06, -7.15249428e-07, 2.75302136e-06, 0.984809875, -0.173643038, -2.40851961e-07, 0.173652872, 0.984805584),
  294. CFrame.new(1.2267952, 0.283012867, -0.709815979, 0.866025388, 0.5, 0, -0.249999985, 0.433012664, -0.866025448, -0.433012724, 0.75, 0.49999997),
  295. CFrame.new(-1.12679291, 0.172679424, -0.727638245, 0.866025388, -0.5, 0, 0.321393758, 0.556670308, -0.766044497, 0.383022249, 0.663414001, 0.642787516),
  296. CFrame.new(0.5, -1.9652729, -0.196968079, 0.99999994, 2.70645933e-06, -5.04924287e-07, 2.75569232e-06, 0.984809816, -0.173643261, -4.67347405e-07, 0.173653096, 0.984805524) * CFrame.new(0, 0, 0+ .5 * math.cos((sine) / 5)) * CFrame.Angles(math.rad(0 - 30 * math.cos((sine) / 5)), 0, 0),
  297. CFrame.new(-0.5, -1.96527576, -0.196968079, 1, 2.70645933e-06, -5.04924287e-07, 2.75569232e-06, 0.984809816, -0.173643261, -4.67347434e-07, 0.173653096, 0.984805524) * CFrame.new(0, 0, 0- .5 * math.cos((sine) / 5)) * CFrame.Angles(math.rad(0 + 30 * math.cos((sine) / 5)), 0, 0),
  298. CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997),
  299. }, .3, false)
  300. else
  301. Humanoid.WalkSpeed = 13
  302. PlayAnimationFromTable({
  303. CFrame.new(0, 0, 0, 0.342019528, 1.77958145e-06, -0.939692795, 3.40915449e-06, 1.00000191, -6.52960921e-07, 0.93969065, 2.98023178e-06, 0.342019796),
  304. CFrame.new(0, 1.50000906, 1.14440918e-05, 0.173647419, -2.75033563e-06, 0.984805226, 6.04339357e-06, 1.00000226, 1.03842858e-05, -0.984807909, 2.48085234e-06, 0.173647329),
  305. CFrame.new(1.00930023, 0.257047653, -0.754802704, 0.642785251, 0.766046405, 7.68762584e-06, -0.383019745, 0.321398407, -0.866024792, -0.663417637, 0.556665003, 0.500001073),
  306. CFrame.new(-1.0977478, 0.360425472, -0.348266602, 0.984804809, -0.173665076, 2.0735275e-05, 0.111646183, 0.63302201, -0.766040623, 0.133021384, 0.754402816, 0.642792106),
  307. CFrame.new(0.499946594, -1.96528363, 0.00305938721, 0.999997497, 5.77095943e-06, -5.96046448e-08, 2.75191974e-06, 1.00000238, -5.7956895e-06, -5.06639481e-07, 4.16327566e-06, 1.00000012) * CFrame.new(0, 0, 0+ .5 * math.cos((sine) / 5)) * CFrame.Angles(math.rad(0 - 30 * math.cos((sine) / 5)), 0, 0),
  308. CFrame.new(-0.500030518, -1.96530366, 0.00305175781, 0.999997497, 5.76745924e-06, -2.98023224e-08, 2.75541925e-06, 1.00000238, -5.7956895e-06, -5.36441803e-07, 4.16327566e-06, 1.00000012) * CFrame.new(0, 0, 0- .5 * math.cos((sine) / 5)) * CFrame.Angles(math.rad(0 + 30 * math.cos((sine) / 5)), 0, 0),
  309. CFrame.new(-0.845115662, -1.07144165, -0.53030777, -0.866025388, -0.249999985, 0.433012724, -0.5, 0.433012664, -0.75, 0, -0.866025448, -0.49999997),
  310. }, .3, false)
  311. end
  312. end
  313.  
  314. if hold == true then
  315. for i,v in pairs(FlameThrower.Fire:GetChildren()) do
  316. if v.Name == "off" then
  317. v.Enabled = false
  318. end
  319. end
  320. for i,v in pairs(FlameThrower.Fire:GetChildren()) do
  321. if v.Name == "on" then
  322. v.Enabled = true
  323. end
  324. end
  325. spawn(Flame)
  326. attack = true
  327. else
  328. attack = false
  329. for i,v in pairs(FlameThrower.Fire:GetChildren()) do
  330. if v.Name == "off" then
  331. v.Enabled = true
  332. end
  333. end
  334. for i,v in pairs(FlameThrower.Fire:GetChildren()) do
  335. if v.Name == "on" then
  336. v.Enabled = false
  337. end
  338. end
  339. end
  340.  
  341. if mus.Parent == char then
  342. mus.SoundId = "rbxassetid://153381341"
  343. mus.Volume = 1
  344. mus.Pitch = 1
  345. mus.Playing = true
  346. mus.Looped = true
  347. timepos = mus.TimePosition
  348. else
  349. mus = Instance.new("Sound",char)
  350. mus.TimePosition = timepos
  351. end
  352. end
Add Comment
Please, Sign In to add comment