Advertisement
yoyo74456

My cool attacks

Sep 4th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.83 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  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 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. Player = game:GetService("Players").LocalPlayer
  8. Char = Player.Character
  9. Mouse = Player:GetMouse()
  10. attacking = false
  11. local tweenService = game:GetService("TweenService")
  12. local num = 1
  13. -----------------------------------------------
  14. Head = Char.Head
  15. Torso = Char.Torso
  16. LArm = Char:FindFirstChild("Left Arm")
  17. LLeg = Char:FindFirstChild("Left Leg")
  18. RArm = Char:FindFirstChild("Right Arm")
  19. RLeg = Char:FindFirstChild("Right Leg")
  20. -----------------------------------------------
  21. Mouse.KeyDown:connect(function(key)
  22. if key:lower() == "e" and attacking == false then
  23. attacking = true
  24. Torso.Anchored = true
  25. for i = 1, 30, 3 do
  26. wait(0.01)
  27. local Part = Instance.new("Part", game.workspace)
  28. Part.Material = "Glass"
  29. Part.Color = Color3.fromRGB(196, 40, 28)
  30. Part.Transparency = 0.7
  31. Part.Name = "Part"..num
  32. Part.Size = Vector3.new(10,1,3)
  33. Part.Size = Part.Size + Vector3.new(i,0,0)
  34. Part.Anchored = true
  35. Part.CFrame = Char.Torso.CFrame * CFrame.new(0,-3,-3 - i)
  36. num = num + 1
  37. Part.Touched:connect(function(Plr)
  38. if Plr.Parent.Humanoid then
  39. Plr.Parent:FindFirstChild("Humanoid"):TakeDamage(9999999)
  40. end
  41. end)
  42. end
  43. wait()
  44. for i = 1, 10, 1 do
  45. wait(0.01)
  46. game.workspace:FindFirstChild("Part"..i):Destroy()
  47. end
  48. num = 1
  49. Torso.Anchored = false
  50. attacking = false
  51. end
  52.  
  53. if key:lower() == "c" and attacking == false then
  54. attacking = true
  55. local Grenade = Instance.new("Part")
  56. local throwPower = 100
  57.  
  58. Grenade.CFrame = Head.CFrame * CFrame.new(0,0,-2)
  59. Grenade.Parent = game.Workspace
  60. Grenade.Velocity = Char.Torso.CFrame.lookVector * throwPower
  61. Grenade.CanCollide = true
  62. wait(2)
  63. Grenade.CanCollide =false
  64. Grenade.Anchored = true
  65. local Area = Instance.new("Part", Grenade)
  66. Area.Anchored = true
  67. Area.Shape = "Cylinder"
  68. Area.CanCollide = false
  69. Area.Color = Color3.fromRGB(196, 40, 28)
  70. Area.Transparency = 0.7
  71. Area.Color = Color3.fromRGB(196, 40, 28)
  72. Area.Size = Vector3.new(0.2, 0, 0)
  73. Area.CFrame = Grenade.CFrame * CFrame.new(0,-0.5,0)
  74. Area.CFrame = Area.CFrame * CFrame.Angles(0,0,math.rad(90))
  75. local tweenInformation = TweenInfo.new (
  76. 2,
  77. Enum.EasingStyle.Quad,
  78. Enum.EasingDirection.Out,
  79. 0,
  80. false,
  81. 0
  82. )
  83.  
  84. local partProperties = {
  85. Size = Vector3.new(0.2, 70, 70)
  86. }
  87.  
  88. local Explosion = tweenService:Create(Area,tweenInformation,partProperties)
  89. Explosion:Play()
  90. wait(2)
  91. Area.Touched:connect(function(Plr)
  92. print(Plr)
  93. if Plr.Parent.Humanoid then
  94. Plr.Parent:FindFirstChild("Humanoid"):TakeDamage(9999999)
  95. else
  96. Plr:Destroy()
  97. end
  98. end)
  99. wait(.5)
  100. Area:Destroy()
  101. Grenade:Destroy()
  102. attacking = false
  103. end
  104.  
  105. if key:lower() == "q" and attacking == false then
  106. if Mouse.Target.Parent:FindFirstChild("Humanoid") then
  107. attacking = true
  108. local T = Mouse.Target.Parent.Torso
  109. T.Anchored = true
  110. local Cyl = Instance.new("Part", game.workspace)
  111. Cyl.Anchored = true
  112. Cyl.Shape = "Cylinder"
  113. Cyl.CanCollide = false
  114. Cyl.Color = Color3.fromRGB(196, 40, 28)
  115. Cyl.Transparency = 0.7
  116. Cyl.Size = Vector3.new(.1,1,2)
  117. Cyl.CFrame = T.CFrame * CFrame.new(0,-3,0)
  118. Cyl.CFrame = Cyl.CFrame * CFrame.Angles(0,0,math.rad(90))
  119. local tweenInformation = TweenInfo.new (
  120. 5,
  121. Enum.EasingStyle.Quad,
  122. Enum.EasingDirection.Out,
  123. 0,
  124. false,
  125. 0
  126. )
  127.  
  128. local partProperties = {
  129. Size = Vector3.new(0.1,5,5)
  130. }
  131.  
  132. local BloodOut = tweenService:Create(Cyl,tweenInformation,partProperties)
  133. BloodOut:Play()
  134. local explosion = Instance.new("Explosion")
  135. explosion.BlastPressure = 0
  136. explosion.DestroyJointRadiusPercent = 0
  137. explosion.BlastRadius = 0
  138. explosion.DestroyJointRadiusPercent = 0
  139. explosion.Position = T.Parent.Head.Position
  140. wait(5)
  141. explosion.Parent = T.Parent.Head
  142. T.Parent.Head.Transparency = 1
  143. if T.Parent.Head:FindFirstChild("face") then
  144. T.Parent.Head.face:Destroy()
  145. end
  146. wait(0.5)
  147. local tweenInformation = TweenInfo.new (
  148. 3,
  149. Enum.EasingStyle.Sine,
  150. Enum.EasingDirection.Out,
  151. 0,
  152. false,
  153. 0
  154. )
  155.  
  156. local partProperties = {
  157. CFrame = T.Parent.Head.CFrame * CFrame.new(0,-10,0)
  158. }
  159.  
  160. local PlayerIn = tweenService:Create(T,tweenInformation,partProperties)
  161. PlayerIn:Play()
  162. wait(3)
  163. T.Anchored = false
  164. T:Destroy()
  165.  
  166. local tweenInformation = TweenInfo.new (
  167. 2,
  168. Enum.EasingStyle.Sine,
  169. Enum.EasingDirection.In,
  170. 0,
  171. false,
  172. 0
  173. )
  174.  
  175. local partProperties = {
  176. Size = Vector3.new(0,0,0)
  177. }
  178.  
  179. local BloodIn = tweenService:Create(Cyl,tweenInformation,partProperties)
  180. BloodIn:Play()
  181. attacking = false
  182. end
  183. end
  184. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement