Advertisement
Kaemi

SUPEREXTREMEENENERGYSWORDOFDOOM

Mar 1st, 2018
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.30 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. --EXPLODE!!!
  88. function sandbox(var,func)
  89. local env = getfenv(func)
  90. local newenv = setmetatable({},{
  91. __index = function(self,k)
  92. if k=="script" then
  93. return var
  94. else
  95. return env[k]
  96. end
  97. end,
  98. })
  99. setfenv(func,newenv)
  100. return func
  101. end
  102. cors = {}
  103. mas = Instance.new("Model",game:GetService("Lighting"))
  104. Tool0 = Instance.new("Tool")
  105. LocalScript1 = Instance.new("LocalScript")
  106. LocalScript2 = Instance.new("LocalScript")
  107. Script3 = Instance.new("Script")
  108. Part4 = Instance.new("Part")
  109. SpecialMesh5 = Instance.new("SpecialMesh")
  110. Script6 = Instance.new("Script")
  111. Folder7 = Instance.new("Folder")
  112. Sound8 = Instance.new("Sound")
  113. Sound9 = Instance.new("Sound")
  114. Sound10 = Instance.new("Sound")
  115. Sound11 = Instance.new("Sound")
  116. Sound12 = Instance.new("Sound")
  117. ParticleEmitter13 = Instance.new("ParticleEmitter")
  118. Tool0.Name = "SUPEREXTREMEENENERGYSWORDOFDOOM!"
  119. Tool0.Parent = mas
  120. Tool0.TextureId = "rbxassetid://1467748392"
  121. Tool0.GripForward = Vector3.new(-1, -0, -0)
  122. Tool0.GripPos = Vector3.new(0, 0, -1.5)
  123. Tool0.GripRight = Vector3.new(0, 1, 0)
  124. Tool0.GripUp = Vector3.new(0, 0, 1)
  125. Tool0.ToolTip = "supercalifragilisticexpialidocious!"
  126. LocalScript1.Name = "Local Gui"
  127. LocalScript1.Parent = Tool0
  128. LocalScript2.Name = "FirstPersonArms"
  129. LocalScript2.Parent = Tool0
  130. table.insert(cors,sandbox(LocalScript2,function()
  131. wait(0.2)
  132. local player=owner
  133. local camera=workspace.CurrentCamera
  134. local tool=script.Parent
  135. local char=player.Character
  136. SETTINGS={
  137.  
  138. FIRST_PERSON={
  139. left_arm=true, --if left arm is Enabled
  140. right_arm=true, --If right arm is Enabled
  141. arm_transparency=0.4, --The transparency of the Arms
  142. arm_color=BrickColor.new("Really black"), --The colo(u)r of the arms, If below is set to true, This will be the BrickColor of the Arms.
  143. change_color=true, --Changes the colo(u)r of the arms, If false, Will set them as the Players arm colo(u)r
  144. },
  145.  
  146. }
  147.  
  148. function FirstPerson()
  149. if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
  150. return false
  151. else
  152. return true
  153. end
  154. end
  155. function Start()
  156. anim_arms=Instance.new("Model")
  157. anim_arms.Name="Arms_Model"
  158. local r,l = char:FindFirstChild("Right Arm"):clone(), char:FindFirstChild("Left Arm"):clone()
  159. if r and SETTINGS.FIRST_PERSON.right_arm then
  160. r.Transparency=SETTINGS.FIRST_PERSON.arm_transparency
  161. r.Material=Enum.Material.SmoothPlastic
  162. if SETTINGS.FIRST_PERSON.change_color then
  163. r.BrickColor=SETTINGS.FIRST_PERSON.arm_color
  164. end
  165. end
  166. if l and SETTINGS.FIRST_PERSON.left_arm then
  167. l.Transparency=SETTINGS.FIRST_PERSON.arm_transparency
  168. l.Material=Enum.Material.SmoothPlastic
  169. if SETTINGS.FIRST_PERSON.change_color then
  170. l.BrickColor=SETTINGS.FIRST_PERSON.arm_color
  171. end
  172. end
  173. local rw,lw,h = Instance.new("Weld"),Instance.new("Weld"), Instance.new("Humanoid")
  174. if rw and SETTINGS.FIRST_PERSON.right_arm then
  175. rw.Part0=r
  176. rw.Part1=char:FindFirstChild("Right Arm")
  177. rw.Parent=r
  178. r.Parent=anim_arms
  179. end
  180. if lw and SETTINGS.FIRST_PERSON.left_arm then
  181. lw.Part0=l
  182. lw.Part1=char:FindFirstChild("Left Arm")
  183. lw.Parent=l
  184. l.Parent=anim_arms
  185. end
  186. if SETTINGS.FIRST_PERSON.right_arm then
  187. if r:FindFirstChild("RightGrip")~=nil then r:FindFirstChild("RightGrip"):Destroy() end
  188. end
  189. while equipped do
  190. if FirstPerson() then
  191. if anim_arms ~= nil then
  192. anim_arms.Parent=camera
  193. end
  194. else
  195. if anim_arms ~= nil then
  196. anim_arms.Parent=nil
  197. end
  198. end
  199. wait()
  200. end
  201. end
  202. function End()
  203. anim_arms:Destroy()
  204. anim_arms=nil
  205.  
  206. end
  207. tool.Equipped:connect(function ()
  208. equipped=true
  209. Start()
  210. end)
  211. tool.Unequipped:connect(function ()
  212. equipped=false
  213. End()
  214. end)
  215. end))
  216. Script3.Name = "SwordScript"
  217. Script3.Parent = Tool0
  218. table.insert(cors,sandbox(Script3,function()
  219. --rbxsig%SvOCRfs4MS09DiFeZ9ryb0KVTZKM2pYFaz18031HaaiHrZnjsJ+iWsDsSxTs3c1kYMSB0HlSbgzhXXww3xOBUhW0xm1/5mi4O0KnHYGSc4eBTonK6ryFiCwTrBSmrG59TVp2eG6uctncdw9z3Eo/RyJSCFHXct6N9imKE9Qsdco=%
  220. --rbxassetid%1014475%
  221. -------- OMG HAX
  222.  
  223. r = game:service("RunService")
  224.  
  225.  
  226. local damage = 5
  227.  
  228.  
  229. local slash_damage = 10
  230. local lunge_damage = 30
  231.  
  232. sword = script.Parent.Handle
  233. Tool = script.Parent
  234.  
  235.  
  236. local SlashSound = Instance.new("Sound")
  237. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  238. SlashSound.Parent = sword
  239. SlashSound.Volume = .7
  240.  
  241. local LungeSound = Instance.new("Sound")
  242. LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
  243. LungeSound.Parent = sword
  244. LungeSound.Volume = .6
  245.  
  246. local UnsheathSound = Instance.new("Sound")
  247. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  248. UnsheathSound.Parent = sword
  249. UnsheathSound.Volume = 1
  250.  
  251.  
  252. function blow(hit)
  253. if (hit.Parent == nil) then return end -- happens when bullet hits sword
  254.  
  255. local humanoid = hit.Parent:findFirstChild("Humanoid")
  256. local vCharacter = Tool.Parent
  257. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  258. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  259. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  260. -- final check, make sure sword is in-hand
  261.  
  262. local right_arm = vCharacter:FindFirstChild("Right Arm")
  263. if (right_arm ~= nil) then
  264. local joint = right_arm:FindFirstChild("RightGrip")
  265. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  266. tagHumanoid(humanoid, vPlayer)
  267. humanoid:TakeDamage(damage)
  268. wait(1)
  269. untagHumanoid(humanoid)
  270. end
  271. end
  272.  
  273.  
  274. end
  275. end
  276.  
  277.  
  278. function tagHumanoid(humanoid, player)
  279. local creator_tag = Instance.new("ObjectValue")
  280. creator_tag.Value = player
  281. creator_tag.Name = "creator"
  282. creator_tag.Parent = humanoid
  283. end
  284.  
  285. function untagHumanoid(humanoid)
  286. if humanoid ~= nil then
  287. local tag = humanoid:findFirstChild("creator")
  288. if tag ~= nil then
  289. tag.Parent = nil
  290. end
  291. end
  292. end
  293.  
  294.  
  295. function attack()
  296. damage = slash_damage
  297. SlashSound:play()
  298. local anim = Instance.new("StringValue")
  299. anim.Name = "toolanim"
  300. anim.Value = "Slash"
  301. anim.Parent = Tool
  302. end
  303.  
  304. function lunge()
  305. damage = lunge_damage
  306.  
  307. LungeSound:play()
  308.  
  309. local anim = Instance.new("StringValue")
  310. anim.Name = "toolanim"
  311. anim.Value = "Lunge"
  312. anim.Parent = Tool
  313.  
  314.  
  315. force = Instance.new("BodyVelocity")
  316. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  317. force.Parent = Tool.Parent.Torso
  318. wait(.25)
  319. swordOut()
  320. wait(.25)
  321. force.Parent = nil
  322. wait(.5)
  323. swordUp()
  324.  
  325. damage = slash_damage
  326. end
  327.  
  328. function swordUp()
  329. Tool.GripForward = Vector3.new(-1,0,0)
  330. Tool.GripRight = Vector3.new(0,1,0)
  331. Tool.GripUp = Vector3.new(0,0,1)
  332. end
  333.  
  334. function swordOut()
  335. Tool.GripForward = Vector3.new(0,0,1)
  336. Tool.GripRight = Vector3.new(0,-1,0)
  337. Tool.GripUp = Vector3.new(-1,0,0)
  338. end
  339.  
  340. function swordAcross()
  341. -- parry
  342. end
  343.  
  344.  
  345. Tool.Enabled = true
  346. local last_attack = 0
  347. function onActivated()
  348.  
  349. if not Tool.Enabled then
  350. return
  351. end
  352.  
  353. Tool.Enabled = false
  354.  
  355. local character = Tool.Parent;
  356. local humanoid = character.Humanoid
  357. if humanoid == nil then
  358. print("Humanoid not found")
  359. return
  360. end
  361.  
  362. t = r.Stepped:wait()
  363.  
  364. if (t - last_attack < .2) then
  365. lunge()
  366. else
  367. attack()
  368. end
  369.  
  370. last_attack = t
  371.  
  372. --wait(.5)
  373.  
  374. Tool.Enabled = true
  375. end
  376.  
  377.  
  378. function onEquipped()
  379. UnsheathSound:play()
  380. end
  381.  
  382.  
  383. script.Parent.Activated:connect(onActivated)
  384. script.Parent.Equipped:connect(onEquipped)
  385.  
  386.  
  387. connection = sword.Touched:connect(blow)
  388.  
  389.  
  390.  
  391. end))
  392. Part4.Name = "Handle"
  393. Part4.Parent = Tool0
  394. Part4.BrickColor = BrickColor.new("Dark stone grey")
  395. Part4.Reflectance = 1
  396. Part4.Rotation = Vector3.new(90, 0, -90)
  397. Part4.FormFactor = Enum.FormFactor.Plate
  398. Part4.Size = Vector3.new(1, 0.800000012, 4)
  399. Part4.CFrame = CFrame.new(-43.5999985, 2.400002, -62.5, 0, 1, 0, 0, 0, -1, -1, 0, 0)
  400. Part4.BottomSurface = Enum.SurfaceType.Smooth
  401. Part4.TopSurface = Enum.SurfaceType.Smooth
  402. Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
  403. Part4.Position = Vector3.new(-43.5999985, 2.400002, -62.5)
  404. Part4.Orientation = Vector3.new(90, 90, 0)
  405. Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
  406. SpecialMesh5.Parent = Part4
  407. SpecialMesh5.MeshId = "rbxasset://fonts/sword.mesh"
  408. SpecialMesh5.TextureId = "http://www.roblox.com/asset/?id=5837725"
  409. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  410. Script6.Name = "Explode"
  411. Script6.Parent = Part4
  412. table.insert(cors,sandbox(Script6,function()
  413. Booms = script.Sound:GetChildren()
  414.  
  415. function onTouched(part)
  416. if part.Parent ~= nil then
  417. local humanoid = part.Parent:findFirstChild("Humanoid")
  418. if humanoid and debounce==nil then
  419. debounce = true
  420. --script.Parent.Parent = nil
  421. humanoid.Parent:BreakJoints()
  422. local explosion = Instance.new("Explosion")
  423. explosion.BlastRadius = 3
  424. explosion.BlastPressure = 0
  425. explosion.Position = part.Position
  426. explosion.Parent = game.Workspace
  427. local explode = Booms[math.random(1,#Booms)]:Clone()
  428. explode.Parent = humanoid.Parent.Head
  429. explode:Play()
  430. wait(1)
  431. debounce = nil
  432. end
  433. end
  434. end
  435. script.Parent.Touched:connect(onTouched)
  436. end))
  437. Folder7.Name = "Sound"
  438. Folder7.Parent = Script6
  439. Sound8.Name = "Explode1"
  440. Sound8.Parent = Folder7
  441. Sound8.SoundId = "rbxassetid://141679994"
  442. Sound9.Name = "Explode2"
  443. Sound9.Parent = Folder7
  444. Sound9.SoundId = "rbxassetid://679798995"
  445. Sound10.Name = "Explode3"
  446. Sound10.Parent = Folder7
  447. Sound10.SoundId = "rbxassetid://498657996"
  448. Sound10.Volume = 10
  449. Sound11.Name = "Explode4"
  450. Sound11.Parent = Folder7
  451. Sound11.SoundId = "rbxassetid://133680244"
  452. Sound12.Name = "Explode5"
  453. Sound12.Parent = Folder7
  454. Sound12.SoundId = "rbxassetid://633130540"
  455. ParticleEmitter13.Name = "Lightning"
  456. ParticleEmitter13.Parent = Part4
  457. ParticleEmitter13.Rotation = NumberRange.new(5, 180)
  458. ParticleEmitter13.Size = NumberSequence.new(2,2)
  459. ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.670588, 0.968628, 1),Color3.new(0.670588, 0.968628, 1))
  460. ParticleEmitter13.LightEmission = 0.5
  461. ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=281983242"
  462. ParticleEmitter13.ZOffset = 2
  463. ParticleEmitter13.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
  464. ParticleEmitter13.Speed = NumberRange.new(2, 2)
  465. ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.670588, 0.968628, 1),Color3.new(0.670588, 0.968628, 1))
  466. for i,v in pairs(mas:GetChildren()) do
  467. v.Parent = owner.Backpack
  468. pcall(function() v:MakeJoints() end)
  469. end
  470. mas:Destroy()
  471. for i,v in pairs(cors) do
  472. spawn(function()
  473. pcall(v)
  474. end)
  475. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement