Advertisement
5325325325

Untitled

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