Advertisement
13242

Untitled

Nov 28th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.50 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 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. script.Parent = workspace.CurrentCamera
  7. local plr = game:GetService("Players").LocalPlayer
  8.  
  9. local tool = Instance.new("Tool",plr:WaitForChild("Backpack"))
  10. tool.Grip = CFrame.new(0,-0.8,-0.2) * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0))
  11. tool.Name = "bluE"
  12.  
  13. local part = Instance.new("Part",tool)
  14. part.Name = "Handle"
  15. part.Size = Vector3.new(4,6,4)
  16. part.TopSurface = "Smooth"
  17. part.BottomSurface = "Smooth"
  18. part.CanCollide = false
  19. part:BreakJoints()
  20.  
  21. local mesh = Instance.new("SpecialMesh",part)
  22. mesh.MeshId = "rbxassetid://431003868" --mesh.MeshId = "rbxassetid://132920499"
  23. mesh.TextureId = "rbxassetid://430627740" --"http://www.roblox.com/asset/?id=134479421"
  24. mesh.Scale = Vector3.new(2,2,2)
  25.  
  26. local sound = Instance.new("Sound",part)
  27. sound.SoundId = "rbxassetid://511340819"
  28. sound.Volume = 3
  29.  
  30. local sound2 = Instance.new("Sound",part)
  31. sound2.SoundId = "rbxassetid://280667448"
  32. sound2.Volume = 5
  33.  
  34. local sound3 = Instance.new("Sound",part)
  35. sound3.SoundId = "rbxassetid://139100774"
  36. sound3.Volume = 10
  37.  
  38. local sound4 = Instance.new("Sound",part)
  39. sound4.SoundId = "rbxassetid://258057783"
  40. sound4.Volume = 10
  41.  
  42. local sound5 = Instance.new("Sound",part)
  43. sound5.SoundId = "rbxassetid://130932305"
  44. sound5.Volume = 10
  45.  
  46. local sound6 = Instance.new("Sound",part)
  47. sound6.SoundId = "rbxassetid://906084456"
  48. sound6.Volume = 10
  49. sound6.TimePosition = 2
  50.  
  51. function firstHum(target)
  52. for i,v in pairs(target:GetChildren()) do
  53. if v:IsA("Humanoid") then
  54. return v
  55. end
  56. end
  57. return nil
  58. end
  59.  
  60. local slap = false
  61. local cd = false
  62.  
  63. plr:GetMouse().Button1Down:connect(function()
  64. if tool.Parent == plr.Character then
  65. if slap == false then
  66. slap = true
  67. sound2:Play()
  68. local str = Instance.new("StringValue")
  69. str.Name = "toolanim"
  70. str.Value = "Slash"
  71. str.Parent = tool
  72. wait(1)
  73. slap = false
  74. end
  75. end
  76. end)
  77.  
  78. part.Touched:connect(function(hit)
  79. if slap == true then
  80. if cd == false then
  81. if not hit:IsDescendantOf(plr.Character) then
  82. if hit.Parent:IsA("Model") then
  83. local fhum = firstHum(hit.Parent)
  84. if fhum then
  85. cd = true
  86. fhum.PlatformStand = true
  87. sound:Play()
  88. local con1
  89. con1 = game:GetService("RunService").Heartbeat:connect(function()
  90. fhum.PlatformStand = true
  91. end)
  92. wait(0.1)
  93. local vel = Instance.new("BodyVelocity",hit)
  94. vel.Velocity = ((hit.Position - plr.Character:WaitForChild("HumanoidRootPart").Position).unit + Vector3.new(0,0.5,0))*50
  95. vel.MaxForce = Vector3.new(10000000,10000000,10000000)
  96. wait(1)
  97. cd = false
  98. vel:Destroy()
  99. local vel2 = Instance.new("BodyVelocity",hit)
  100. vel2.Velocity = Vector3.new(0,12.5,0)
  101. vel2.MaxForce = Vector3.new(10000000,10000000,10000000)
  102. local p2 = Instance.new("Part",hit)
  103. p2.Anchored = true
  104. p2.Transparency = 0.6
  105. p2.CanCollide = false
  106. p2.Size = Vector3.new(0.2,0.2,0.2)
  107. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  108. p2.BrickColor = BrickColor.new("New Yeller")
  109. p2.Material = "Neon"
  110. local m2 = Instance.new("CylinderMesh",p2)
  111. m2.Scale = Vector3.new(60,10000,60)
  112. local scln = sound3:Clone()
  113. scln.Parent = hit
  114. scln:Play()
  115. local con2
  116. con2 = game:GetService("RunService").Heartbeat:connect(function()
  117. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  118. end)
  119. wait(7)
  120. vel2.Velocity = Vector3.new(0,0,0)
  121. wait(0.5)
  122. scln:Stop()
  123. local scln3 = sound5:Clone()
  124. scln3.Parent = hit
  125. scln3:Play()
  126. wait(1)
  127. local bav = Instance.new("BodyAngularVelocity",hit)
  128. bav.AngularVelocity = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
  129. vel2.Velocity = Vector3.new(0,-250,0)
  130. p2.BrickColor = BrickColor.new("Really red")
  131. local scln6 = sound6:Clone()
  132. scln6.Parent = hit
  133. scln6:Play()
  134. local continue = false
  135. local htc
  136. htc = hit.Touched:connect(function(hitp)
  137. if not hitp:IsDescendantOf(hit.Parent) then
  138. continue = true
  139. scln6:Stop()
  140. vel2:Destroy()
  141. con2:Disconnect()
  142. con1:Disconnect()
  143. htc:Disconnect()
  144. p2:Destroy()
  145. end
  146. end)
  147. repeat wait() until continue == true
  148. local ctab = {}
  149. for i=1,4 do
  150. local p = Instance.new("Part",hit)
  151. p.Size = Vector3.new(30,30,30)
  152. p.Anchored = true
  153. p.CanCollide = false
  154. p.TopSurface = "Smooth"
  155. p.BottomSurface = "Smooth"
  156. p.Color = Color3.fromRGB(255,math.random(0,255),0)
  157. p.CFrame = hit.CFrame
  158. local con
  159. con = game:GetService("RunService").Heartbeat:connect(function()
  160. p.CFrame = p.CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  161. p.Transparency = p.Transparency + 0.01
  162. if p.Transparency >= 1 then
  163. con:Disconnect()
  164. end
  165. end)
  166. table.insert(ctab,con)
  167. end
  168. Instance.new("Explosion",workspace).Position = hit.Position
  169. local scln2 = sound4:Clone()
  170. scln2.Parent = hit
  171. scln2:Play()
  172. vel2:Destroy()
  173. hit.Parent:BreakJoints()
  174. repeat wait() until not hit:IsDescendantOf(workspace)
  175. con2:Disconnect()
  176. end
  177. end
  178. end
  179. end
  180. end
  181. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement