Advertisement
StarzoZero

Roblox FE Mettaton Blasters

Dec 23rd, 2018
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.59 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 = game:GetService("Players").LocalPlayer
  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 Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. --[[ This script was converted by WafflesAreVeryGood(Nobody#3907 on discord) ]]--
  88. local plr=owner
  89. repeat wait() until plr.Character
  90. wait(0.5)
  91. local char=plr.Character
  92. local hum=char:WaitForChild("Humanoid")
  93. local torso=char:WaitForChild("Torso")
  94. local hrp=char:WaitForChild("HumanoidRootPart")
  95. local check=false
  96. local dmg=false
  97. local size="M"
  98. local type="Normal"
  99. local equipped=false
  100. local combo=false
  101. local comboing=false
  102.  
  103. --Converted with ttyyuu12345's model to script plugin v4
  104. function sandbox(var,func)
  105. local env = getfenv(func)
  106. local newenv = setmetatable({},{
  107. __index = function(self,k)
  108. if k=="script" then
  109. return var
  110. else
  111. return env[k]
  112. end
  113. end,
  114. })
  115. setfenv(func,newenv)
  116. return func
  117. end
  118. cors = {}
  119. mas = Instance.new("Model",game:GetService("Lighting"))
  120. Tool0 = Instance.new("Tool")
  121. Folder1 = Instance.new("Folder")
  122. Sound2 = Instance.new("Sound")
  123. Sound3 = Instance.new("Sound")
  124. Part4 = Instance.new("Part")
  125. SpecialMesh5 = Instance.new("SpecialMesh")
  126. Part6 = Instance.new("Part")
  127. BlockMesh7 = Instance.new("BlockMesh")
  128. ManualWeld8 = Instance.new("ManualWeld")
  129. Part9 = Instance.new("Part")
  130. SpecialMesh10 = Instance.new("SpecialMesh")
  131. Part11 = Instance.new("Part")
  132. BlockMesh12 = Instance.new("BlockMesh")
  133. ManualWeld13 = Instance.new("ManualWeld")
  134. Animation14 = Instance.new("Animation")
  135. Tool0.Name = "Mettaton"
  136. Tool0.Parent = mas
  137. Tool0.TextureId = "http://www.roblox.com/asset/?id=316134665"
  138. Tool0.ToolTip = "Bombs and Bots: Used by Mettaton"
  139. Tool0.CanBeDropped = false
  140. Tool0.RequiresHandle = false
  141. Folder1.Parent = Tool0
  142. Sound2.Name = "Launch"
  143. Sound2.Parent = Folder1
  144. Sound2.Pitch = 0.30000001192093
  145. Sound2.SoundId = "rbxassetid://298553078"
  146. Sound2.Volume = 1
  147. Sound3.Name = "Prepare"
  148. Sound3.Parent = Folder1
  149. Sound3.Pitch = 0.69999998807907
  150. Sound3.SoundId = "rbxassetid://297237983"
  151. Part4.Name = "BigSpear"
  152. Part4.Parent = Folder1
  153. Part4.Rotation = Vector3.new(-180, 0, -180)
  154. Part4.Anchored = true
  155. Part4.CanCollide = false
  156. Part4.FormFactor = Enum.FormFactor.Custom
  157. Part4.Size = Vector3.new(2, 24, 2)
  158. Part4.CFrame = CFrame.new(-700.027527, 2111.1001, 184.568634, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  159. Part4.BottomSurface = Enum.SurfaceType.Smooth
  160. Part4.TopSurface = Enum.SurfaceType.Smooth
  161. Part4.Position = Vector3.new(-700.027527, 2111.1001, 184.568634)
  162. Part4.Orientation = Vector3.new(0, 180, 0)
  163. SpecialMesh5.Parent = Part4
  164. SpecialMesh5.MeshId = "http://www.roblox.com/asset/?id=431180351"
  165. SpecialMesh5.Scale = Vector3.new(0.00499999989, 0.00499999989, 0.00499999989)
  166. SpecialMesh5.TextureId = "rbxassetid://431180357"
  167. SpecialMesh5.VertexColor = Vector3.new(0.400000006, 0.400000006, 0.5)
  168. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  169. SpecialMesh5.Scale = Vector3.new(0.00499999989, 0.00499999989, 0.00499999989)
  170. Part6.Name = "Glow"
  171. Part6.Parent = Part4
  172. Part6.Material = Enum.Material.Neon
  173. Part6.CanCollide = false
  174. Part6.FormFactor = Enum.FormFactor.Custom
  175. Part6.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  176. Part6.CFrame = CFrame.new(-700.028015, 2111.1001, 184.569, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  177. Part6.Position = Vector3.new(-700.028015, 2111.1001, 184.569)
  178. BlockMesh7.Parent = Part6
  179. BlockMesh7.Scale = Vector3.new(0, 0, 0)
  180. BlockMesh7.VertexColor = Vector3.new(0.400000006, 0.400000006, 0.5)
  181. BlockMesh7.Scale = Vector3.new(0, 0, 0)
  182. ManualWeld8.Name = "Weld"
  183. ManualWeld8.Parent = Part4
  184. ManualWeld8.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  185. ManualWeld8.C1 = CFrame.new(0.000503540039, 0, -0.000381469727, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  186. ManualWeld8.Part0 = Part4
  187. ManualWeld8.Part1 = Part6
  188. Part9.Name = "Spear"
  189. Part9.Parent = Folder1
  190. Part9.BrickColor = BrickColor.new("Really black")
  191. Part9.Rotation = Vector3.new(-180, 0, -180)
  192. Part9.Anchored = true
  193. Part9.CanCollide = false
  194. Part9.FormFactor = Enum.FormFactor.Custom
  195. Part9.Size = Vector3.new(0.5, 7.80000019, 0.5)
  196. Part9.CFrame = CFrame.new(-695.627502, 2111.1001, 184.168625, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  197. Part9.BottomSurface = Enum.SurfaceType.Smooth
  198. Part9.TopSurface = Enum.SurfaceType.Smooth
  199. Part9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  200. Part9.Position = Vector3.new(-695.627502, 2111.1001, 184.168625)
  201. Part9.Orientation = Vector3.new(0, 180, 0)
  202. Part9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  203. SpecialMesh10.Parent = Part9
  204. SpecialMesh10.MeshId = "rbxassetid://448093537"
  205. SpecialMesh10.Scale = Vector3.new(0.00999999978, 0.00999999978, 0.00999999978)
  206. SpecialMesh10.VertexColor = Vector3.new(0.300000012, 0, 0.300000012)
  207. SpecialMesh10.MeshType = Enum.MeshType.FileMesh
  208. SpecialMesh10.Scale = Vector3.new(0.00999999978, 0.00999999978, 0.00999999978)
  209. Part11.Name = "Glow"
  210. Part11.Parent = Part9
  211. Part11.Material = Enum.Material.Neon
  212. Part11.CanCollide = false
  213. Part11.FormFactor = Enum.FormFactor.Custom
  214. Part11.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  215. Part11.CFrame = CFrame.new(-695.627991, 2111.1001, 184.169006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  216. Part11.Position = Vector3.new(-695.627991, 2111.1001, 184.169006)
  217. BlockMesh12.Parent = Part11
  218. BlockMesh12.Scale = Vector3.new(0, 0, 0)
  219. BlockMesh12.VertexColor = Vector3.new(0.300000012, 0.300000012, 0.300000012)
  220. BlockMesh12.Scale = Vector3.new(0, 0, 0)
  221. ManualWeld13.Name = "Weld"
  222. ManualWeld13.Parent = Part9
  223. ManualWeld13.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  224. ManualWeld13.C1 = CFrame.new(0.000503540039, 0, -0.000381469727, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  225. ManualWeld13.Part0 = Part9
  226. ManualWeld13.Part1 = Part11
  227. Animation14.Name = "GBSend"
  228. Animation14.Parent = Folder1
  229. Animation14.AnimationId = "http://www.roblox.com/GBSend-item?id=388238523"
  230. for i,v in pairs(mas:GetChildren()) do
  231. v.Parent = owner
  232. pcall(function() v:MakeJoints() end)
  233. end
  234. mas:Destroy()
  235. for i,v in pairs(cors) do
  236. spawn(function()
  237. pcall(v)
  238. end)
  239. end
  240.  
  241. local tool=Tool0
  242. tool.Parent = plr.Backpack
  243. script.Parent = tool
  244. for i,v in pairs(tool.Folder:GetChildren()) do
  245. v.Parent = script
  246. end
  247. tool.Folder:Destroy()
  248. local gbsend=hum:LoadAnimation(script.GBSend)
  249. local srot=0
  250. local closest=nil
  251. local attacklist={}
  252. local spears={}
  253. local spos={
  254. [1]={110},
  255. [2]={60}
  256. }
  257.  
  258. function Loop()
  259. coroutine.resume(coroutine.create(function()
  260. while equipped==true do
  261. if #spears==2 then
  262. for i,v in pairs(spears) do
  263. v.BodyPosition.Position=(hrp.CFrame*CFrame.new(math.cos(math.rad(spos[i][1]))*10,math.sin(math.rad(spos[i][1]))*7,6)).p
  264. v.BodyGyro.CFrame=CFrame.new(v.Position,mouse.Hit.p)*CFrame.Angles(-math.pi/0.5,math.rad(srot),0)
  265. srot=srot+0
  266. if srot==360 then srot=0 end
  267. end
  268. end
  269. wait()
  270. end
  271. end))
  272. end
  273.  
  274. function PrepareHurt(proj,dmgcheck,dmg)
  275. proj.Touched:connect(function(hit)
  276. if hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent ~= char and proj.Transparency<1 and dmgcheck==false then
  277. dmgcheck=true
  278. hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(dmg)
  279. end
  280. end)
  281. end
  282.  
  283. local function FIRE(obj,mode)
  284. coroutine.resume(coroutine.create(function()
  285. local dmgcheck=false
  286. if mode=="Normal" then
  287. local bv=Instance.new("BodyVelocity",obj)
  288. bv.MaxForce=Vector3.new(math.huge,math.huge,math.huge)
  289. wait(0.5)
  290. local faiya=script.Launch:Clone()
  291. faiya.Parent=obj
  292. faiya:Play()
  293. bv.Velocity=(obj.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*300
  294. PrepareHurt(obj,dmgcheck,15)
  295. end
  296. wait(0.5)
  297. end))
  298. end
  299.  
  300. function Lerp(obj,kind,nb,total,spec)
  301. local mousehit=CFrame.new(mouse.Hit.X,mouse.Hit.Y,mouse.Hit.Z)
  302. if kind~="Square" then
  303. obj.Anchored=false
  304. end
  305. if kind=="Front" then
  306. obj.CFrame=hrp.CFrame*CFrame.new(math.random(-10,10),math.random(0,5),-5)
  307. elseif kind=="Circle" then
  308. if closest==nil then
  309. obj.CFrame=mousehit*CFrame.new(math.cos(math.rad(nb*(360/total)))*20,obj.Size.X/2,math.sin(math.rad(nb*(360/total)))*20)
  310. else
  311. obj.CFrame=closest.HumanoidRootPart.CFrame*CFrame.new(math.cos(math.rad(nb*(360/total)))*20,-2+(obj.Size.X/2),math.sin(math.rad(nb*(360/total)))*20)
  312. end
  313. elseif kind=="Square" then
  314. if closest==nil then
  315. obj.CFrame=mousehit
  316. wait(0.2)
  317. for i=1,5 do
  318. obj.Transparency=1
  319. wait(0.1)
  320. obj.Transparency=0.1
  321. wait(0.1)
  322. end
  323. FIRE(obj,"Square")
  324. end
  325. end
  326. local bodyg=Instance.new("BodyGyro",obj)
  327. bodyg.MaxTorque=Vector3.new(math.huge,math.huge,math.huge)
  328. bodyg.D=160
  329. if spec=="Multi" then
  330. bodyg.CFrame=CFrame.new(obj.Position,hitpos)*CFrame.Angles(-math.pi/2,0,0)
  331. elseif spec=="Normal" then
  332. bodyg.CFrame=CFrame.new(obj.Position,hitpos)*CFrame.Angles(-math.pi/2,0,0)
  333. end
  334. end
  335.  
  336. function PrepareAttack(key)
  337. if check==false and hum.Health>0 then
  338. if closest==nil then
  339. hitpos=mouse.Hit.p
  340. else
  341. hitpos=closest.Torso.Position
  342. end
  343. if equipped==true then
  344. if key=="q" then
  345. combo=true
  346. elseif key=="e" then
  347. if combo==false then
  348. check=true
  349. hum.WalkSpeed=0
  350. gbsend:Play()
  351. for i=1,5 do
  352. local s=script.BigSpear:Clone()
  353. s.Parent=workspace
  354. local prep=script.Prepare:Clone()
  355. prep.Parent=s
  356. prep:Play()
  357. coroutine.resume(coroutine.create(function()
  358. Lerp(s,"Front",1,1,"Normal")
  359. FIRE(s,"Normal")
  360. end))
  361. wait(0.1)
  362. end
  363. hum.WalkSpeed=30
  364. if comboing==false then
  365. wait(0.4)
  366. else
  367. wait(0.25)
  368. end
  369. check=false
  370. elseif combo==true and #attacklist<5 then
  371. table.insert(attacklist,key)
  372. end
  373. elseif key=="r" then
  374. if combo==false then
  375. check=true
  376. hum.WalkSpeed=0
  377. gbsend:Play()
  378. for i=1,#spears do
  379. local s=script.Spear:Clone()
  380. s.Parent=workspace
  381. s.CFrame=spears[i].CFrame
  382. local prep=script.Prepare:Clone()
  383. prep.Parent=s
  384. prep:Play()
  385. spears[i].Transparency=0
  386. coroutine.resume(coroutine.create(function()
  387. Lerp(s,"Circle",i,2,"Normal")
  388. FIRE(s,"Normal")
  389. end))
  390. wait(0.1)
  391. end
  392. hum.WalkSpeed=30
  393. if comboing==false then
  394. wait(0.4)
  395. else
  396. wait(0.35)
  397. end
  398. for _,v in pairs(spears) do
  399. v.Transparency=0
  400. end
  401. check=false
  402. elseif combo==true and #attacklist<5 then
  403. table.insert(attacklist,key)
  404. end
  405. elseif key=="t" then
  406. if combo==false then
  407. check=true
  408. hum.WalkSpeed=0
  409. gbsend:Play()
  410. for i=1,10 do
  411. local s=script.Spear:Clone()
  412. s.Parent=workspace
  413. local prep=script.Prepare:Clone()
  414. prep.Parent=s
  415. prep:Play()
  416. coroutine.resume(coroutine.create(function()
  417. Lerp(s,"Front",i,10,"Multi")
  418. FIRE(s,"Normal")
  419. end))
  420. end
  421. hum.WalkSpeed=30
  422. if comboing==false then
  423. wait(3)
  424. else
  425. wait(0.5)
  426. end
  427. check=false
  428. elseif combo==true and #attacklist<5 then
  429. table.insert(attacklist,key)
  430. end
  431. end
  432. end
  433. end
  434. end
  435.  
  436. mouse.KeyUp:connect(function(key)
  437. if key=="q" and combo==true and check==false then
  438. combo=false
  439. comboing=true
  440. for _,v in pairs(attacklist) do
  441. PrepareAttack(v)
  442. end
  443. attacklist={}
  444. comboing=false
  445. check=true
  446. wait(2)
  447. check=false
  448. end
  449. end)
  450.  
  451. mouse.KeyDown:connect(PrepareAttack)
  452.  
  453. tool.Equipped:connect(function()
  454. for i=1,2 do
  455. local spear=script.BigSpear:Clone()
  456. spear.Parent=char
  457. spear.Anchored=false
  458. spear.CFrame=(hrp.CFrame*CFrame.new(math.cos(math.rad((2*36)-(i*36)))*10,math.sin(math.rad((2*36)-(i*36)))*-10,0))
  459. table.insert(spears,spear)
  460. local sbp=Instance.new("BodyPosition",spear)
  461. sbp.MaxForce=Vector3.new(math.huge,math.huge,math.huge)
  462. sbp.D=800
  463. local sbg=Instance.new("BodyGyro",spear)
  464. sbg.MaxTorque=Vector3.new(math.huge,math.huge,math.huge)
  465. sbg.D=400
  466. end
  467. equipped=true
  468. Loop()
  469. end)
  470. tool.Unequipped:connect(function()
  471. equipped=false
  472. for _,v in pairs(spears) do
  473. v:Destroy()
  474. end
  475. spears={}
  476. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement