Znimator

Untitled

Sep 24th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.96 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = owner
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local h,t
  75. --Give the server mouse data 30 times every second, but only if the values changed
  76. --If player is not moving their mouse, client won't fire events
  77. while wait(1/30) do
  78. if h~=Mouse.Hit or t~=Mouse.Target then
  79. h,t=Mouse.Hit,Mouse.Target
  80. Event:FireServer({isMouse=true,Target=t,Hit=h})
  81. end
  82. end]==],Player.Character)
  83. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  84. end
  85.  
  86. script.Parent = workspace.CurrentCamera
  87. local plr = owner
  88.  
  89. local tool = Instance.new("Tool",plr:WaitForChild("Backpack"))
  90. tool.Grip = CFrame.new(0,-0.8,-0.2) * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0))
  91. tool.Name = "bluE"
  92.  
  93. local part = Instance.new("Part",tool)
  94. part.Name = "Handle"
  95. part.Size = Vector3.new(4,6,4)
  96. part.TopSurface = "Smooth"
  97. part.BottomSurface = "Smooth"
  98. part.CanCollide = false
  99. part:BreakJoints()
  100.  
  101. local mesh = Instance.new("SpecialMesh",part)
  102. mesh.MeshId = "rbxassetid://431003868" --mesh.MeshId = "rbxassetid://132920499"
  103. mesh.TextureId = "rbxassetid://430627740" --"http://www.roblox.com/asset/?id=134479421"
  104. mesh.Scale = Vector3.new(2,2,2)
  105.  
  106. local sound = Instance.new("Sound",part)
  107. sound.SoundId = "rbxassetid://511340819"
  108. sound.Volume = 3
  109.  
  110. local sound2 = Instance.new("Sound",part)
  111. sound2.SoundId = "rbxassetid://280667448"
  112. sound2.Volume = 5
  113.  
  114. local sound3 = Instance.new("Sound",part)
  115. sound3.SoundId = "rbxassetid://139100774"
  116. sound3.Volume = 10
  117.  
  118. local sound4 = Instance.new("Sound",part)
  119. sound4.SoundId = "rbxassetid://258057783"
  120. sound4.Volume = 10
  121.  
  122. local sound5 = Instance.new("Sound",part)
  123. sound5.SoundId = "rbxassetid://130932305"
  124. sound5.Volume = 10
  125.  
  126. local sound6 = Instance.new("Sound",part)
  127. sound6.SoundId = "rbxassetid://906084456"
  128. sound6.Volume = 10
  129. sound6.TimePosition = 2
  130.  
  131. function firstHum(target)
  132. for i,v in pairs(target:GetChildren()) do
  133. if v:IsA("Humanoid") then
  134. return v
  135. end
  136. end
  137. return nil
  138. end
  139.  
  140. local slap = false
  141. local cd = false
  142.  
  143.  
  144. part.Touched:connect(function(hit)
  145. if slap == true then
  146. if cd == false then
  147. if not hit:IsDescendantOf(plr.Character) then
  148. if hit.Parent:IsA("Model") then
  149. local fhum = firstHum(hit.Parent)
  150. if fhum then
  151. cd = true
  152. fhum.PlatformStand = true
  153. sound:Play()
  154. local con1
  155. con1 = game:GetService("RunService").Heartbeat:connect(function()
  156. fhum.PlatformStand = true
  157. end)
  158. wait(0.1)
  159. local vel = Instance.new("BodyVelocity",hit)
  160. vel.Velocity = ((hit.Position - plr.Character:WaitForChild("HumanoidRootPart").Position).unit + Vector3.new(0,0.5,0))*50
  161. vel.MaxForce = Vector3.new(10000000,10000000,10000000)
  162. wait(1)
  163. cd = false
  164. vel:Destroy()
  165. local vel2 = Instance.new("BodyVelocity",hit)
  166. vel2.Velocity = Vector3.new(0,12.5,0)
  167. vel2.MaxForce = Vector3.new(10000000,10000000,10000000)
  168. local p2 = Instance.new("Part",hit)
  169. p2.Anchored = true
  170. p2.Transparency = 0.6
  171. p2.CanCollide = false
  172. p2.Size = Vector3.new(0.2,0.2,0.2)
  173. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  174. p2.BrickColor = BrickColor.new("New Yeller")
  175. p2.Material = "Neon"
  176. local m2 = Instance.new("CylinderMesh",p2)
  177. m2.Scale = Vector3.new(60,10000,60)
  178. local scln = sound3:Clone()
  179. scln.Parent = hit
  180. scln:Play()
  181. local con2
  182. con2 = game:GetService("RunService").Heartbeat:connect(function()
  183. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  184. end)
  185. wait(7)
  186. vel2.Velocity = Vector3.new(0,0,0)
  187. wait(0.5)
  188. scln:Stop()
  189. local scln3 = sound5:Clone()
  190. scln3.Parent = hit
  191. scln3:Play()
  192. wait(1)
  193. local bav = Instance.new("BodyAngularVelocity",hit)
  194. bav.AngularVelocity = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
  195. vel2.Velocity = Vector3.new(0,-250,0)
  196. p2.BrickColor = BrickColor.new("Really red")
  197. local scln6 = sound6:Clone()
  198. scln6.Parent = hit
  199. scln6:Play()
  200. local continue = false
  201. local htc
  202. htc = hit.Touched:connect(function(hitp)
  203. if not hitp:IsDescendantOf(hit.Parent) then
  204. continue = true
  205. scln6:Stop()
  206. vel2:Destroy()
  207. con2:Disconnect()
  208. con1:Disconnect()
  209. htc:Disconnect()
  210. p2:Destroy()
  211. end
  212. end)
  213. repeat wait() until continue == true
  214. local ctab = {}
  215. for i=1,4 do
  216. local p = Instance.new("Part",hit)
  217. p.Size = Vector3.new(30,30,30)
  218. p.Anchored = true
  219. p.CanCollide = false
  220. p.TopSurface = "Smooth"
  221. p.BottomSurface = "Smooth"
  222. p.Color = Color3.fromRGB(255,math.random(0,255),0)
  223. p.CFrame = hit.CFrame
  224. local con
  225. con = game:GetService("RunService").Heartbeat:connect(function()
  226. p.CFrame = p.CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  227. p.Transparency = p.Transparency + 0.01
  228. if p.Transparency >= 1 then
  229. con:Disconnect()
  230. end
  231. end)
  232. table.insert(ctab,con)
  233. end
  234. Instance.new("Explosion",workspace).Position = hit.Position
  235. local scln2 = sound4:Clone()
  236. scln2.Parent = hit
  237. scln2:Play()
  238. vel2:Destroy()
  239. hit.Parent:BreakJoints()
  240. repeat wait() until not hit:IsDescendantOf(workspace)
  241. con2:Disconnect()
  242. end
  243. end
  244. end
  245. end
  246. end
  247. end)
Advertisement
Add Comment
Please, Sign In to add comment