Advertisement
EmeraldIT

Untitled

Oct 21st, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.98 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.  
  89. Gem = Instance.new("Part")
  90. Gem.CanCollide = false
  91. Gem.Material = "Neon"
  92. Gem.Size = Vector3.new(1.5,1.5,1.5)
  93. Gem.Color = BrickColor.new("White").Color
  94. Gem.Name = "Handle"
  95. GemShine = Gem:Clone()
  96. GemShine.Size = Vector3.new(1.55,1.55,1.55)
  97. GemShine.Material = "Glass"
  98. GemShine.Color = BrickColor.new("Medium blue").Color
  99. GemShine.Transparency = 0.5
  100. GemShine.Reflectance = 0.5
  101. GemShine.Name = "TheHandlesShine"
  102. GemWeld = Instance.new("Weld", Gem)
  103. GemWeld.Part0 = Gem
  104. GemWeld.Part1 = GemShine
  105. Tool = Instance.new("Tool", bag)
  106. Gem.Parent = Tool
  107. GemShine.Parent = Tool
  108.  
  109. anger = false
  110.  
  111. mouse.Button1Down:Connect(function()
  112. if equipped == true then
  113. spawn(function()
  114. local ray = Ray.new(Gem.CFrame.p,(mouse.Hit.p-Gem.CFrame.p).unit*1250)
  115. local part,position = workspace:FindPartOnRay(ray,Phoenix.Character, false, true)
  116. local distance = (Gem.CFrame.p - position).magnitude
  117. if part then
  118. if part.Parent:FindFirstChild("Humanoid") then
  119. part:BreakJoints()
  120. part.Anchored=false
  121. end
  122. end
  123.  
  124. local beam = Instance.new("Part", Phoenix.Character)
  125. beam.BrickColor = GemShine.BrickColor
  126. beam.FormFactor = "Custom"
  127. beam.Material = "Neon"
  128. beam.Transparency = 0.5
  129. beam.Anchored = true
  130. beam.Locked = true
  131. beam.CanCollide = false
  132. beam.Size = Vector3.new(0.3, 0.3, distance)
  133. beam.CFrame = CFrame.new((Gem.CFrame*CFrame.new(0,0,0)).p, mouse.Hit.p) * CFrame.new(0, 0, -distance/2)
  134. beam.Touched:Connect(function(h)
  135. if anger == true then
  136. if h.Parent.Name ~= owner.Character.Name and h ~= Gem and h ~= GemShine then
  137. if h.ClassName == "BasePart" or h.ClassName == "Part" or h.ClassName == "MeshPart" then
  138. if h.Name == "Base" then return end
  139. h.Anchored = false
  140. if h.Parent.ClassName == "Model" then
  141. h.Parent:BreakJoints()
  142. for _,v in pairs(h:GetChildren()) do
  143. if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "BasePart" then
  144. v.Parent = workspace
  145. v.Anchored = false
  146. v.Velocity = Vector3.new(math.random(-1000,1000), math.random(-1000,1000), math.random(-1000,1000))
  147. elseif v.ClassName == "Weld" then
  148. v:Remove()
  149. end
  150. end
  151. end
  152. h.Velocity = Vector3.new(math.random(-1000,1000), math.random(-1000,1000), math.random(-1000,1000))
  153. end
  154. if h.Parent.ClassName == "Accessory" or h.ClassName == "Accessory" then return end
  155. game.Debris:AddItem(h,3)
  156. end
  157. elseif demolition == true then
  158. if h.Parent.Name ~= owner.Character.Name and h ~= Gem and h ~= GemShine then
  159. h:BreakJoints()
  160. if h.Parent ~= workspace then h.Parent:BreakJoints()
  161. for _,v in pairs(h:GetDescendants()) do
  162. if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "BasePart" then
  163. local bambam = Instance.new("BodyVelocity")
  164. bambam.Parent = v
  165. bambam.P = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  166. bambam.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  167. v.Anchored = false
  168. spawn(function()
  169. wait(.1)
  170. bambam:Remove()
  171. game.Debris:AddItem(v,3)
  172. end)
  173. end
  174. end
  175. end)
  176. spawn(function()
  177. game.Debris:AddItem(beam,2)
  178. for i=1,30 do
  179. beam.Transparency=i/30
  180. wait()
  181. end
  182. end)
  183. spawn(function()
  184. for i=1,30 do
  185. beam.Size=Vector3.new(i/4,i/4,beam.Size.Z)
  186. wait()
  187. end
  188. end)
  189. spawn(function()
  190. for i=1,30 do
  191. beam.CFrame = beam.CFrame * CFrame.Angles(0,0,0.1)
  192. wait()
  193. end
  194. end)
  195. end)
  196. end
  197. end)
  198.  
  199. Tool.Equipped:Connect(function()
  200. equipped = true
  201. end)
  202.  
  203. Tool.Unequipped:Connect(function()
  204. equipped = false
  205. end)
  206.  
  207. owner.Chatted:Connect(function(EEE)
  208. if EEE == "*anger*" and anger == false then
  209. if demolition == true then return end
  210. anger = true
  211. for i = 1,30 do
  212. GemShine.Color = GemShine.Color:Lerp(Color3.fromRGB(255,0,0),0.1)
  213. wait()
  214. end
  215. wait(10)
  216. for i = 1,30 do
  217. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Medium blue").Color,0.1)
  218. wait()
  219. end
  220. anger = false
  221. elseif EEE == "*explosion*" and demolition == false then
  222. if anger == true then return end
  223. demolition = true
  224. for i = 1,30 do
  225. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Dark indigo").Color,0.1)
  226. wait()
  227. end
  228. wait(10)
  229. for i = 1,30 do
  230. GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Medium blue").Color,0.1)
  231. wait()
  232. end
  233. demolition = false
  234. end
  235. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement