Advertisement
HenloMyDude

flamethrower

Oct 27th, 2019
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.49 KB | None | 0 0
  1.  
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. function Smooth(part)
  8. part.TopSurface = "Smooth"
  9. part.BottomSurface = "Smooth"
  10. part.RightSurface = "Smooth"
  11. part.LeftSurface = "Smooth"
  12. end
  13.  
  14. plr = owner
  15. char = plr.Character
  16. ra = char["Right Arm"]
  17. root = char.HumanoidRootPart
  18. hum = char.Humanoid
  19.  
  20. clerp = function(toclerp, cf, number)
  21. local joint = toclerp
  22. joint.C0 = joint.C0:Lerp(cf, number)
  23. end
  24.  
  25. clerp2 = function(toclerp, cf)
  26. local joint = toclerp
  27. joint.C0 = cf
  28. end
  29.  
  30. clerp3 = function(toclerp, cf, number)
  31. local joint = toclerp
  32. joint.C1 = joint.C1:Lerp(cf, number)
  33. end
  34.  
  35. Swait,swait = function(number)
  36. if number == 0 or number == nil then
  37. game:GetService("RunService").Heartbeat:Wait()
  38. else
  39. for i = 1,number do
  40. game:GetService("RunService").Heartbeat:Wait()
  41. end
  42. end
  43. end
  44.  
  45. ezweld = function(p, a, b, cf)
  46. local weld = Instance.new("Weld",p)
  47. weld.Part0 = a
  48. weld.Part1 = b
  49. weld.C0 = cf
  50. return weld
  51. end
  52.  
  53. IT = Instance.new
  54. Rad = math.rad
  55. Cos = math.cos
  56. Sin = math.sin
  57. BrickC = BrickColor.new
  58. C3 = Color3.new
  59. VT = Vector3.new
  60.  
  61. local fakera = Instance.new("Model",char)
  62. fakera.Name = "FakeArm"
  63. local part1 = Instance.new("Part",fakera)
  64. part1.Shape = "Cylinder"
  65. part1.Size = VT(2.5, 1.5, 1.5)
  66. part1.BrickColor = BrickC("Black")
  67. part1.CanCollide = false
  68. part1.Name = "BottomFatPart"
  69. Smooth(part1)
  70. local part2 = IT("Part",fakera)
  71. part2.Shape = "Cylinder"
  72. part2.Size = VT(6, 0.75, 0.5)
  73. part2.BrickColor = BrickC("Black")
  74. part2.CanCollide = false
  75. part2.Name = "TopSlimPart"
  76. Smooth(part2)
  77. local part3 = IT("Part",fakera)
  78. part3.Size = VT(0.1, 0.1, 0.1)
  79. part3.BrickColor = BrickC("Black")
  80. part3.Transparency = 1
  81. part3.CanCollide = false
  82. part3.Name = "ParticleHolder"
  83. Smooth(part3)
  84. local particle1 = Instance.new("ParticleEmitter",part3)
  85. particle1.Texture = "http://www.roblox.com/asset/?id=20121664"
  86. particle1.LockedToPart = false
  87. particle1.Name = "Fire"
  88. particle1.Enabled = false
  89. particle1.Size = NumberSequence.new(0.23, 0.15)
  90. particle1.Lifetime = NumberRange.new(5)
  91. particle1.LightEmission = NumberSequence.new(1)
  92. particle1.EmissionDirection = "Left"
  93. particle1.VelocityInheritance = NumberSequence.new(1)
  94. particle1.Rotation = NumberRange.new(155)
  95. particle1.RotSpeed = NumberRange.new(50)
  96. particle1.Speed = NumberRange.new(7)
  97. particle1.SpreadAngle = Vector2.new(8.5, 5)
  98. particle1.Rate = 35
  99. particle1.LightEmission = 0.2
  100. particle1.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,Color3.fromRGB(255,0,0)),ColorSequenceKeypoint.new(0.5,BrickColor.new("Neon orange").Color),ColorSequenceKeypoint.new(1,BrickColor.new("New Yeller").Color)})
  101. local particle2 = Instance.new("ParticleEmitter",part3)
  102. particle2.Texture = "http://www.roblox.com/asset/?id=20121664"
  103. particle2.LockedToPart = false
  104. particle2.Name = "Fire"
  105. particle2.Enabled = true
  106. particle2.Size = NumberSequence.new(0.23 / 2, 0.15 / 2)
  107. particle2.Lifetime = NumberRange.new(0.5)
  108. particle2.LightEmission = NumberSequence.new(1)
  109. particle2.EmissionDirection = "Left"
  110. particle2.VelocityInheritance = NumberSequence.new(1)
  111. particle2.Rotation = NumberRange.new(155)
  112. particle2.RotSpeed = NumberRange.new(50)
  113. particle2.Speed = NumberRange.new(2.5)
  114. particle2.SpreadAngle = Vector2.new(8.5, 5)
  115. particle2.Rate = 35
  116. particle2.LightEmission = 0.2
  117. particle2.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,Color3.fromRGB(255,0,0)),ColorSequenceKeypoint.new(0.25,BrickColor.new("Neon orange").Color),ColorSequenceKeypoint.new(0.5,BrickColor.new("New Yeller").Color),ColorSequenceKeypoint.new(1,BrickColor.new("New Yeller").Color)})
  118. conparticle = particle1:Clone()
  119. conparticle.Parent = part3
  120. conparticle.Rate = 45
  121. conparticle.Size = NumberSequence.new(0.345 / 2, 0.345 / 2)
  122. conparticle.RotSpeed = NumberRange.new(70)
  123. conparticle.Speed = NumberRange.new(3.5)
  124. conparticle.SpreadAngle = Vector2.new(100, 1000)
  125. conparticle.Acceleration = Vector3.new(0, -5, 0)
  126. conparticle.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,BrickColor.new("Royal purple").Color),ColorSequenceKeypoint.new(0.15,BrickColor.new("Navy blue").Color),ColorSequenceKeypoint.new(0.35,BrickColor.new("Cyan").Color),ColorSequenceKeypoint.new(1,BrickColor.new("Cyan").Color)})
  127. local weld1 = ezweld( fakera, part1, ra, CFrame.new(0, 0, 0) * CFrame.Angles(Rad(0), Rad(0), Rad(-90)) )
  128. local weld2 = ezweld( fakera, part2, part1, CFrame.new(2, 0, 0) * CFrame.Angles(Rad(0), Rad(0), Rad(0)) )
  129. local weld3 = ezweld( fakera, part3, part2, CFrame.new(3, 0, 0) * CFrame.Angles(Rad(0), Rad(0), Rad(0)) )
  130.  
  131. --more stuff--
  132.  
  133. anim = "Idle"
  134. attack = false
  135. local RS = char.Torso["Right Shoulder"]
  136. local LS = char.Torso["Left Shoulder"]
  137. local RH = char.Torso["Right Hip"]
  138. local LH = char.Torso["Left Hip"]
  139. local neck = char.Torso["Neck"]
  140. local anim = "Idle"
  141. local rootj = char.HumanoidRootPart.RootJoint
  142. local timepos = 0
  143. local sine = 0
  144. local RSnor = RS.C0
  145. local LSnor = LS.C0
  146. local RHnor = RH.C0
  147. local LHnor = LH.C0
  148. local RSnor2 = RS.C1
  149. local LSnor2 = LS.C1
  150. local RHnor2 = RH.C1
  151. local LHnor2 = LH.C1
  152. local rootjnor = rootj.C0
  153. local necknor = neck.C0
  154. hum.Animator:Destroy()
  155. hold = false
  156. mouse = plr:GetMouse()
  157. hold = false
  158. Debris = game:GetService("Debris")
  159.  
  160. --------------
  161.  
  162. local sound = Instance.new("Sound",ra)
  163. sound.SoundId = "rbxassetid://239443642"
  164. sound.Volume = 1000000000
  165. sound.Looped = true
  166. local sound2 = Instance.new("Sound",ra)
  167. sound2.SoundId = "rbxassetid://239443642"
  168. sound2.Volume = 1000000000
  169. sound2.Looped = true
  170. local light = Instance.new("PointLight",part3)
  171. light.Range = 3
  172.  
  173. function burn()
  174. attack = true
  175. particle2.Enabled = false
  176. particle1.Enabled = true
  177. sound:Play()
  178. sound2:Play()
  179. light.Range = 8
  180. local hitbox = Instance.new("Part",fakera)
  181. hitbox.Transparency = 1
  182. hitbox.CanCollide = false
  183. hitbox.CFrame = ra.CFrame
  184. hitbox.Size = Vector3.new(3.5, 4.75, 8)
  185. hitbox.Name = "Fire"
  186. local weld4 = ezweld( fakera, hitbox, ra, CFrame.new(0, 0, 8 / 2.5) * CFrame.Angles(Rad(90), Rad(0), Rad(0)) )
  187. local hitter = hitbox.Touched:connect(function(hit)
  188. if hit.Parent ~= char then
  189. local particle = particle2:Clone()
  190. particle.Parent = hit
  191. particle.EmissionDirection = "Top"
  192. particle.Name = "Fire"
  193. particle.Enabled = true
  194. local nub = hit.Parent
  195. Debris:AddItem(particle, 0.5)
  196. for _,v in pairs (nub:GetChildren()) do
  197. if v:IsA("Humanoid") then
  198. v.Health = v.Health - 0.35
  199. end
  200. end
  201. end
  202. end)
  203. repeat
  204. Swait()
  205. clerp(rootj, rootjnor * CFrame.new(0, 0, 0 + 0.1 * Cos(sine / 4)), 0.15)
  206. clerp(RH, RHnor * CFrame.new(0, 0 - 0.1 * Cos(sine / 4), 0) * CFrame.Angles(0, 0, 0), 0.15)
  207. clerp(LH, LHnor * CFrame.new(0, 0 - 0.1 * Cos(sine / 4), 0) * CFrame.Angles(0, 0, 0), 0.15)
  208. clerp(RS, RSnor * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, Rad(90)), 0.15)
  209. clerp(LS, LSnor * CFrame.Angles(0, 0, 0), 0.15)
  210. until hold == false
  211. hitbox:Destroy()
  212. light.Range = 3
  213. sound2:Stop()
  214. sound:Stop()
  215. particle2.Enabled = true
  216. particle1.Enabled = false
  217. attack = false
  218. end
  219.  
  220. function confetti()
  221. attack = true
  222. particle2.Enabled = false
  223. particle1.Enabled = false
  224. conparticle.Enabled = true
  225. for i = 1,55 do
  226. Swait()
  227. clerp(rootj, rootjnor * CFrame.new(0, 0, 0 + 0.1 * Cos(sine / 4)), 0.15)
  228. clerp(RH, RHnor * CFrame.new(0, 0 - 0.1 * Cos(sine / 4), 0) * CFrame.Angles(0, 0, 0), 0.15)
  229. clerp(LH, LHnor * CFrame.new(0, 0 - 0.1 * Cos(sine / 4), 0) * CFrame.Angles(0, 0, 0), 0.15)
  230. clerp(RS, RSnor * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, Rad(90) + Rad(45)), 0.15)
  231. clerp(LS, LSnor * CFrame.Angles(0, 0, 0), 0.15)
  232. end
  233. particle2.Enabled = true
  234. particle1.Enabled = false
  235. conparticle.Enabled = false
  236. attack = false
  237. end
  238.  
  239. mouse.Button1Down:connect(function()
  240. hold = true
  241. if attack == false then
  242. burn()
  243. end
  244. end)
  245.  
  246. mouse.Button1Up:connect(function()
  247. hold = false
  248. end)
  249.  
  250. mouse.KeyDown:connect(function(key)
  251. if key == "e" and attack == false then
  252. confetti()
  253. end
  254. end)
  255.  
  256. while true do
  257. Swait()
  258. ra.Transparency = 1
  259. sine = sine + 1
  260. local TORSOVELOCITY = (root.Velocity * VT(1, 0, 1)).magnitude
  261. if TORSOVELOCITY < 1 then
  262. anim = "Idle"
  263. if attack == false then
  264. clerp(rootj, rootjnor * CFrame.new(0, 0, 0 + 0.1 * Cos(sine / 12)), 0.15)
  265. clerp(RH, RHnor * CFrame.new(0, 0 - 0.1 * Cos(sine / 12), 0) * CFrame.Angles(0, Rad(-10), 0), 0.15)
  266. clerp(LH, LHnor * CFrame.new(0, 0 - 0.1 * Cos(sine / 12), 0) * CFrame.Angles(0, Rad(10), 0), 0.15)
  267. clerp(RS, RSnor * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, Rad(180)), 0.15)
  268. clerp(LS, LSnor * CFrame.Angles(Rad(5 + 15 * Cos(sine / 12)), 0, 0), 0.15)
  269. end
  270. clerp3(RH, RHnor2 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), 0.15)
  271. clerp3(LH, LHnor2 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), 0.15)
  272. clerp3(LS, LSnor2 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), 0.15)
  273. else
  274. anim = "Walk"
  275. if attack == false then
  276. clerp(rootj, rootjnor * CFrame.new(0, 0, 0 + 0.2 * Cos(sine / 4)), 0.15)
  277. clerp(RH, RHnor * CFrame.new(0.25, 0 - 0.2 * Cos(sine / 4), 0) * CFrame.Angles(0, Rad(0), 0), 0.15)
  278. clerp(LH, LHnor * CFrame.new(-0.25, 0 - 0.2 * Cos(sine / 4), 0) * CFrame.Angles(0, Rad(0), 0), 0.15)
  279. clerp(RS, RSnor * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, Rad(180)), 0.15)
  280. clerp(LS, LSnor * CFrame.Angles(0, 0, 0), 0.15)
  281. end
  282. clerp3(RH, RHnor2 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0.5 + 1.25 * Cos(sine / 8)), 0.15)
  283. clerp3(LH, LHnor2 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, -0.5 + 1.25 * Cos(sine / 8)), 0.15)
  284. clerp3(LS, LSnor2 * CFrame.Angles(0, 0, 0 - 1 * Cos(sine / 8)), 0.15)
  285. end
  286. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement