Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- Phoenix = game.Players.PhoenixClockworks
- bag = Phoenix.Backpack
- equipped = false
- demolition = false
- Gem = Instance.new("Part")
- Gem.CanCollide = false
- Gem.Material = "Neon"
- Gem.Size = Vector3.new(1.5,1.5,1.5)
- Gem.Color = BrickColor.new("White").Color
- Gem.Name = "Handle"
- GemShine = Gem:Clone()
- GemShine.Size = Vector3.new(1.55,1.55,1.55)
- GemShine.Material = "Glass"
- GemShine.Color = BrickColor.new("Medium blue").Color
- GemShine.Transparency = 0.5
- GemShine.Reflectance = 0.5
- GemShine.Name = "TheHandlesShine"
- GemWeld = Instance.new("Weld", Gem)
- GemWeld.Part0 = Gem
- GemWeld.Part1 = GemShine
- Tool = Instance.new("Tool", bag)
- Gem.Parent = Tool
- GemShine.Parent = Tool
- anger = false
- mouse.Button1Down:Connect(function()
- if equipped == true then
- spawn(function()
- local ray = Ray.new(Gem.CFrame.p,(mouse.Hit.p-Gem.CFrame.p).unit*1250)
- local part,position = workspace:FindPartOnRay(ray,Phoenix.Character, false, true)
- local distance = (Gem.CFrame.p - position).magnitude
- if part then
- if part.Parent:FindFirstChild("Humanoid") then
- part:BreakJoints()
- part.Anchored=false
- end
- end
- local beam = Instance.new("Part", Phoenix.Character)
- beam.BrickColor = GemShine.BrickColor
- beam.FormFactor = "Custom"
- beam.Material = "Neon"
- beam.Transparency = 0.5
- beam.Anchored = true
- beam.Locked = true
- beam.CanCollide = false
- beam.Size = Vector3.new(0.3, 0.3, distance)
- beam.CFrame = CFrame.new((Gem.CFrame*CFrame.new(0,0,0)).p, mouse.Hit.p) * CFrame.new(0, 0, -distance/2)
- beam.Touched:Connect(function(h)
- if anger == true then
- if h.Parent.Name ~= owner.Character.Name and h ~= Gem and h ~= GemShine then
- if h.ClassName == "BasePart" or h.ClassName == "Part" or h.ClassName == "MeshPart" then
- if h.Name == "Base" then return end
- h.Anchored = false
- if h.Parent.ClassName == "Model" then
- h.Parent:BreakJoints()
- for _,v in pairs(h:GetChildren()) do
- if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "BasePart" then
- v.Parent = workspace
- v.Anchored = false
- v.Velocity = Vector3.new(math.random(-1000,1000), math.random(-1000,1000), math.random(-1000,1000))
- elseif v.ClassName == "Weld" then
- v:Remove()
- end
- end
- end
- h.Velocity = Vector3.new(math.random(-1000,1000), math.random(-1000,1000), math.random(-1000,1000))
- end
- if h.Parent.ClassName == "Accessory" or h.ClassName == "Accessory" then return end
- game.Debris:AddItem(h,3)
- end
- elseif demolition == true then
- if h.Parent.Name ~= owner.Character.Name and h ~= Gem and h ~= GemShine then
- h:BreakJoints()
- if h.Parent ~= workspace then h.Parent:BreakJoints()
- for _,v in pairs(h:GetDescendants()) do
- if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "BasePart" then
- local bambam = Instance.new("BodyVelocity")
- bambam.Parent = v
- bambam.P = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
- bambam.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- v.Anchored = false
- spawn(function()
- wait(.1)
- bambam:Remove()
- game.Debris:AddItem(v,3)
- end)
- end
- end
- end)
- spawn(function()
- game.Debris:AddItem(beam,2)
- for i=1,30 do
- beam.Transparency=i/30
- wait()
- end
- end)
- spawn(function()
- for i=1,30 do
- beam.Size=Vector3.new(i/4,i/4,beam.Size.Z)
- wait()
- end
- end)
- spawn(function()
- for i=1,30 do
- beam.CFrame = beam.CFrame * CFrame.Angles(0,0,0.1)
- wait()
- end
- end)
- end)
- end
- end)
- Tool.Equipped:Connect(function()
- equipped = true
- end)
- Tool.Unequipped:Connect(function()
- equipped = false
- end)
- owner.Chatted:Connect(function(EEE)
- if EEE == "*anger*" and anger == false then
- if demolition == true then return end
- anger = true
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(Color3.fromRGB(255,0,0),0.1)
- wait()
- end
- wait(10)
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Medium blue").Color,0.1)
- wait()
- end
- anger = false
- elseif EEE == "*explosion*" and demolition == false then
- if anger == true then return end
- demolition = true
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Dark indigo").Color,0.1)
- wait()
- end
- wait(10)
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Medium blue").Color,0.1)
- wait()
- end
- demolition = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement