Advertisement
EmeraldIT

Untitled

Oct 22nd, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.27 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. Phoenix = game.Players.PhoenixClockworks
  85. bag = Phoenix.Backpack
  86. equipped = false
  87. demolition = false
  88. stairs = false
  89. anger = false
  90. shield = false
  91. fol = Instance.new("Folder", Phoenix.Character)
  92.  
  93. Gem = Instance.new("Part")
  94. Gem.CanCollide = false
  95. Gem.Material = "Neon"
  96. Gem.Size = Vector3.new(1.5,1.5,1.5)
  97. Gem.Color = BrickColor.new("White").Color
  98. Gem.Name = "Handle"
  99. GemShine = Gem:Clone()
  100. GemShine.Size = Vector3.new(1.55,1.55,1.55)
  101. GemShine.Material = "Glass"
  102. GemShine.Color = BrickColor.new("Medium blue").Color
  103. GemShine.Transparency = 0.5
  104. GemShine.Reflectance = 0.5
  105. GemShine.Name = "TheHandlesShine"
  106. Gem.Locked = true
  107. GemShine.Locked = true
  108. GemWeld = Instance.new("Weld", Gem)
  109. GemWeld.Part0 = Gem
  110. GemWeld.Part1 = GemShine
  111. Tool = Instance.new("Tool", bag)
  112. Gem.Parent = Tool
  113. GemShine.Parent = Tool
  114.  
  115. function fling(hit)
  116. if hit.Parent.Parent.ClassName == "Script" or hit.Parent.Parent.ClassName == "LocalScript" then hit.Parent.Parent = workspace end
  117. if hit.Name ~= "Base" and hit.Parent ~= char and hit.Parent.Parent ~= char and hit ~= Gem and hit ~= GemShine then
  118. if hit.ClassName == "Part" or hit.ClassName == "MeshPart" or hit.ClassName == "BasePart" or hit.ClassName == "CornerWedgePart" or hit.ClassName == "WedgePart" or hit.ClassName == "TrussPart" then
  119. pcall(function() hit:BreakJoints() end)
  120. hit.Anchored = false
  121. A1 = Instance.new("Attachment",hit)
  122. A1.Position = Vector3.new(0, 2, 0)
  123. local A2 = Instance.new("Attachment",hit)
  124. A2.Position = Vector3.new(0, -2, 0)
  125. local Trail = Instance.new("Trail",hit)
  126. Trail.LightEmission = 1
  127. Trail.FaceCamera = true
  128. Trail.Texture = "rbxassetid://945758042"
  129. Trail.Attachment0 = A1
  130. Trail.Attachment1 = A2
  131. Trail.Lifetime = 1
  132. Trail.MinLength = 0
  133. Trail.Transparency = NumberSequence.new(0, 0)
  134. Trail.Color = ColorSequence.new(BrickColor.new("Dark indigo").Color,BrickColor.new("Royal purple").Color)
  135. hit.Velocity = Vector3.new(hit.Velocity.X+ math.random(-200,200), hit.Velocity.Y + math.random(-200,200), hit.Velocity.Z+ math.random(-200,200))
  136. end
  137. end
  138. end
  139.  
  140. function shieldyboio()
  141. Sh = Instance.new("Part", fol)
  142. Sh.Size = Vector3.new(10,10,10)
  143. Sh.Material = "ForceField"
  144. Sh.CFrame= Phoenix.Character.HumanoidRootPart.CFrame
  145. Sh.Color = Color3.fromRGB(0,255,0)
  146. Sh.CanCollide = false
  147. Sh.Transparency = 1
  148. Sh.Shape = "Ball"
  149. Sh2 = Instance.new("Part", fol)
  150. Sh2.Size = Vector3.new(15,15,15)
  151. Sh2.Material = "ForceField"
  152. Sh2.CFrame= Phoenix.Character.HumanoidRootPart.CFrame
  153. Sh2.Color = Color3.fromRGB(0,255,0)
  154. Sh2.CanCollide = false
  155. Sh2.Transparency = 1
  156. Sh2.Shape = "Ball"
  157. local char = Phoenix.Character
  158. weld = Instance.new("Weld", Sh)
  159. weld.Part0 = Phoenix.Character.HumanoidRootPart
  160. weld.Part1 = Sh
  161. weld = Instance.new("Weld", Sh2)
  162. weld.Part0 = Phoenix.Character.HumanoidRootPart
  163. weld.Part1 = Sh2
  164. spawn(function()
  165. for i = 1,20 do
  166. Sh.Transparency = Sh.Transparency - 1/20
  167. Sh2.Transparency = Sh2.Transparency - 1/20
  168. wait()
  169. end
  170. end)
  171. Sh2.Touched:Connect(function(hit)
  172. if hit.Name == "Bullet" then
  173. hit:Remove()
  174. end
  175. if hit.Name ~= "Base" and hit.Parent ~= char and hit.Parent.Parent ~= char and hit ~= Gem and hit ~= GemShine and hit ~= Sh2 and hit ~= Sh and hit.Parent ~= fol then
  176. if hit.Name == "Bullet" then
  177. hit:Remove()
  178. end
  179. if hit.Name == "Beam" then
  180. hit:Remove()
  181. end
  182. hit.Parent = nil
  183. end
  184. end)
  185. Sh.Touched:Connect(function(hit)
  186. if hit.Name == "Bullet" then
  187. hit:Remove()
  188. end
  189. if hit.Name ~= "Base" and hit.Parent ~= char and hit.Parent.Parent ~= char and hit ~= Gem and hit ~= GemShine and hit ~= Sh2 and hit ~= Sh and hit.Parent ~= fol then
  190. if hit.Name == "Bullet" then
  191. hit:Remove()
  192. end
  193. if hit.Name == "Beam" then
  194. hit:Remove()
  195. end
  196. hit.Parent = nil
  197. end
  198. end)
  199. end
  200.  
  201. mouse.Button1Down:Connect(function()
  202. if equipped == true then
  203. if shield ~= true then
  204. spawn(function()
  205. local ray = Ray.new(Gem.CFrame.p,(mouse.Hit.p-Gem.CFrame.p).unit*1000)
  206. local part,position = workspace:FindPartOnRay(ray,Phoenix.Character, false, true)
  207. local distance = (Gem.CFrame.p - position).magnitude
  208. if part then
  209. if part.Parent:FindFirstChild("Humanoid") then
  210. part:BreakJoints()
  211. part.Anchored=false
  212. end
  213. end
  214.  
  215. local beam = Instance.new("Part", fol)
  216. beam.BrickColor = GemShine.BrickColor
  217. beam.FormFactor = "Custom"
  218. beam.Material = "Neon"
  219. beam.Transparency = 0.5
  220. if shield == true then
  221. beam.Transparency = 1
  222. end
  223. if stairs == true then
  224. beam.Transparency = 1
  225. end
  226. beam.Anchored = true
  227. beam.Locked = true
  228. beam.CanCollide = false
  229. beam.Size = Vector3.new(0.3, 0.3, distance)
  230. beam.CFrame = CFrame.new((Gem.CFrame*CFrame.new(0,0,0)).p, mouse.Hit.p) * CFrame.new(0, 0, -distance/2)
  231.  
  232. staircasing = false
  233.  
  234. if stairs == true then
  235. staircase()
  236. end
  237.  
  238. beam.Touched:Connect(function(h)
  239. if stairs == false then
  240.  
  241. if anger == true then
  242.  
  243. if h.Parent.Name ~= owner.Character.Name and h ~= Gem and h ~= GemShine and h.Parent ~= fol then
  244. if h.ClassName == "BasePart" or h.ClassName == "Part" or h.ClassName == "MeshPart" then
  245. if h.Name == "Base" then return end
  246. h.Anchored = false
  247. if h.Parent.ClassName == "Model" then
  248. h.Parent:BreakJoints()
  249. for _,v in pairs(h:GetChildren()) do
  250. if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "BasePart" then
  251. v.Parent = workspace
  252. v.Anchored = false
  253. v.Velocity = Vector3.new(math.random(-1000,1000), math.random(-1000,1000), math.random(-1000,1000))
  254. elseif v.ClassName == "Weld" then
  255. v:Remove()
  256. end
  257. end
  258. end
  259. h.Velocity = Vector3.new(math.random(-1000,1000), math.random(-1000,1000), math.random(-1000,1000))
  260. end
  261. if h.Parent.ClassName == "Accessory" or h.ClassName == "Accessory" then return end
  262. game.Debris:AddItem(h,3)
  263. end
  264.  
  265. elseif demolition == true then
  266.  
  267. if h.Parent.ClassName == "Model" then
  268. if h.Parent.Name ~= Phoenix.Character.Name then
  269. for _,v in pairs(h.Parent:GetDescendants()) do
  270. fling(v)
  271. end
  272. end
  273. else
  274. if h ~= Gem and h ~= GemShine and h.Parent ~= Phoenix.Character then
  275. fling(h)
  276. end
  277. end
  278.  
  279.  
  280. end
  281. end
  282. end)
  283. spawn(function()
  284. game.Debris:AddItem(beam,2)
  285. for i=1,30 do
  286. if stairs == true then
  287. beam.Transparency=1
  288. end
  289. if shield == true then
  290. beam.Transparency=1
  291. end
  292. if shield == false and stairs == false then
  293. beam.Transparency=i/30
  294. end
  295. wait()
  296. end
  297. end)
  298. spawn(function()
  299. for i=1,30 do
  300. if anger == false then
  301. beam.Size=Vector3.new(i/4,i/4,beam.Size.Z)
  302. else
  303. beam.Size=Vector3.new(i,i,beam.Size.Z)
  304. end
  305. wait()
  306. end
  307. end)
  308. spawn(function()
  309. for i=1,30 do
  310. beam.CFrame = beam.CFrame * CFrame.Angles(0,0,0.1)
  311. wait()
  312. end
  313. end)
  314. end)
  315. elseif shield == true then
  316. shieldyboio()
  317. end
  318. end
  319. end)
  320.  
  321. function staircase()
  322. Part1 = Instance.new("Part", fol)
  323. Part1.Size = Vector3.new(5,1,5)
  324. Part1.Material = "Neon"
  325. Part1.Anchored = true
  326. Part1.CFrame = Phoenix.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3,0)
  327. Part2 = Instance.new("Part", fol)
  328. Part2.Size = Vector3.new(5.05,1.05,5.05)
  329. Part2.Material = "Glass"
  330. Part2.Anchored = true
  331. Part2.CFrame = Phoenix.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3,0)
  332. Part2.Transparency = 0.5
  333. Part2.Color = BrickColor.new("Bright orange").Color
  334. Part2.Reflectance = 0.5
  335. game.Debris:AddItem(Part1,10)
  336. game.Debris:AddItem(Part2,10)
  337. number = 0
  338. spawn(function()
  339. for i = 1,9 do
  340. number = number + 5
  341. Part1 = Instance.new("Part", fol)
  342. Part1.Size = Vector3.new(5,1,5)
  343. Part1.Material = "Neon"
  344. Part1.Anchored = true
  345. Part1.CFrame = Phoenix.Character.HumanoidRootPart.CFrame * CFrame.new(math.random(-3,3),number,0-number)
  346. Part2 = Instance.new("Part", fol)
  347. Part2.Size = Vector3.new(5.05,1.05,5.05)
  348. Part2.Material = "Glass"
  349. Part2.Anchored = true
  350. Part2.CFrame = Part1.CFrame
  351. Part2.Transparency = 0.5
  352. Part2.Color = BrickColor.new("Bright orange").Color
  353. Part2.Reflectance = 0.5
  354. game.Debris:AddItem(Part1,10)
  355. game.Debris:AddItem(Part2,10)
  356. wait()
  357. end
  358. end)
  359. end
  360.  
  361. Tool.Equipped:Connect(function()
  362. equipped = true
  363. end)
  364.  
  365. Tool.Unequipped:Connect(function()
  366. equipped = false
  367. end)
  368.  
  369. transforming = false
  370.  
  371. Mouse.KeyDown:Connect(function(k)
  372. if k == "z" then
  373. if transforming == true then return end
  374. transforming = true
  375. anger = true
  376. stairs = false
  377. shield = false
  378. demolition = false
  379. spawn(function()
  380. for i = 1,30 do
  381. GemShine.Color = GemShine.Color:Lerp(Color3.fromRGB(255,0,0),0.1)
  382. wait()
  383. end
  384. transforming = false
  385. end)
  386. elseif k == "x" then
  387. if transforming == true then return end
  388. transforming = true
  389. anger = false
  390. stairs = false
  391. shield = false
  392. demolition = true
  393. spawn(function()
  394. for i = 1,30 do
  395. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Dark indigo").Color,0.1)
  396. wait()
  397. end
  398. transforming = false
  399. end)
  400. elseif k == "c" then
  401. if transforming == true then return end
  402. transforming = true
  403. anger = false
  404. stairs = true
  405. shield = false
  406. demolition = false
  407. spawn(function()
  408. for i = 1,30 do
  409. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Bright orange").Color,0.1)
  410. wait()
  411. end
  412. transforming = false
  413. end)
  414. elseif k == "b" then
  415. if transforming == true then return end
  416. transforming = true
  417. anger = false
  418. stairs = false
  419. shield = false
  420. demolition = false
  421. spawn(function()
  422. for i = 1,30 do
  423. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Medium blue").Color,0.1)
  424. wait()
  425. end
  426. transforming = false
  427. end)
  428. elseif k == "v" then
  429. if transforming == true then return end
  430. transforming = true
  431. anger = false
  432. stairs = false
  433. shield = true
  434. demolition = false
  435. spawn(function()
  436. for i = 1,30 do
  437. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Lime green").Color,0.1)
  438. wait()
  439. end
  440. transforming = false
  441. end)
  442. end
  443. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement