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
- stairs = false
- anger = false
- shield = false
- fol = Instance.new("Folder", Phoenix.Character)
- 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"
- Gem.Locked = true
- GemShine.Locked = true
- GemWeld = Instance.new("Weld", Gem)
- GemWeld.Part0 = Gem
- GemWeld.Part1 = GemShine
- Tool = Instance.new("Tool", bag)
- Gem.Parent = Tool
- GemShine.Parent = Tool
- function fling(hit)
- if hit.Parent.Parent.ClassName == "Script" or hit.Parent.Parent.ClassName == "LocalScript" then hit.Parent.Parent = workspace end
- if hit.Name ~= "Base" and hit.Parent ~= char and hit.Parent.Parent ~= char and hit ~= Gem and hit ~= GemShine then
- 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
- pcall(function() hit:BreakJoints() end)
- hit.Anchored = false
- A1 = Instance.new("Attachment",hit)
- A1.Position = Vector3.new(0, 2, 0)
- local A2 = Instance.new("Attachment",hit)
- A2.Position = Vector3.new(0, -2, 0)
- local Trail = Instance.new("Trail",hit)
- Trail.LightEmission = 1
- Trail.FaceCamera = true
- Trail.Texture = "rbxassetid://945758042"
- Trail.Attachment0 = A1
- Trail.Attachment1 = A2
- Trail.Lifetime = 1
- Trail.MinLength = 0
- Trail.Transparency = NumberSequence.new(0, 0)
- Trail.Color = ColorSequence.new(BrickColor.new("Dark indigo").Color,BrickColor.new("Royal purple").Color)
- 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))
- end
- end
- end
- function shieldyboio()
- Sh = Instance.new("Part", fol)
- Sh.Size = Vector3.new(10,10,10)
- Sh.Material = "ForceField"
- Sh.CFrame= Phoenix.Character.HumanoidRootPart.CFrame
- Sh.Color = Color3.fromRGB(0,255,0)
- Sh.CanCollide = false
- Sh.Transparency = 1
- Sh.Shape = "Ball"
- Sh2 = Instance.new("Part", fol)
- Sh2.Size = Vector3.new(15,15,15)
- Sh2.Material = "ForceField"
- Sh2.CFrame= Phoenix.Character.HumanoidRootPart.CFrame
- Sh2.Color = Color3.fromRGB(0,255,0)
- Sh2.CanCollide = false
- Sh2.Transparency = 1
- Sh2.Shape = "Ball"
- local char = Phoenix.Character
- weld = Instance.new("Weld", Sh)
- weld.Part0 = Phoenix.Character.HumanoidRootPart
- weld.Part1 = Sh
- weld = Instance.new("Weld", Sh2)
- weld.Part0 = Phoenix.Character.HumanoidRootPart
- weld.Part1 = Sh2
- spawn(function()
- for i = 1,20 do
- Sh.Transparency = Sh.Transparency - 1/20
- Sh2.Transparency = Sh2.Transparency - 1/20
- wait()
- end
- end)
- Sh2.Touched:Connect(function(hit)
- if hit.Name == "Bullet" then
- hit:Remove()
- end
- 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
- if hit.Name == "Bullet" then
- hit:Remove()
- end
- if hit.Name == "Beam" then
- hit:Remove()
- end
- hit.Parent = nil
- end
- end)
- Sh.Touched:Connect(function(hit)
- if hit.Name == "Bullet" then
- hit:Remove()
- end
- 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
- if hit.Name == "Bullet" then
- hit:Remove()
- end
- if hit.Name == "Beam" then
- hit:Remove()
- end
- hit.Parent = nil
- end
- end)
- end
- mouse.Button1Down:Connect(function()
- if equipped == true then
- if shield ~= true then
- spawn(function()
- local ray = Ray.new(Gem.CFrame.p,(mouse.Hit.p-Gem.CFrame.p).unit*1000)
- 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", fol)
- beam.BrickColor = GemShine.BrickColor
- beam.FormFactor = "Custom"
- beam.Material = "Neon"
- beam.Transparency = 0.5
- if shield == true then
- beam.Transparency = 1
- end
- if stairs == true then
- beam.Transparency = 1
- end
- 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)
- staircasing = false
- if stairs == true then
- staircase()
- end
- beam.Touched:Connect(function(h)
- if stairs == false then
- if anger == true then
- if h.Parent.Name ~= owner.Character.Name and h ~= Gem and h ~= GemShine and h.Parent ~= fol 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.ClassName == "Model" then
- if h.Parent.Name ~= Phoenix.Character.Name then
- for _,v in pairs(h.Parent:GetDescendants()) do
- fling(v)
- end
- end
- else
- if h ~= Gem and h ~= GemShine and h.Parent ~= Phoenix.Character then
- fling(h)
- end
- end
- end
- end
- end)
- spawn(function()
- game.Debris:AddItem(beam,2)
- for i=1,30 do
- if stairs == true then
- beam.Transparency=1
- end
- if shield == true then
- beam.Transparency=1
- end
- if shield == false and stairs == false then
- beam.Transparency=i/30
- end
- wait()
- end
- end)
- spawn(function()
- for i=1,30 do
- if anger == false then
- beam.Size=Vector3.new(i/4,i/4,beam.Size.Z)
- else
- beam.Size=Vector3.new(i,i,beam.Size.Z)
- end
- wait()
- end
- end)
- spawn(function()
- for i=1,30 do
- beam.CFrame = beam.CFrame * CFrame.Angles(0,0,0.1)
- wait()
- end
- end)
- end)
- elseif shield == true then
- shieldyboio()
- end
- end
- end)
- function staircase()
- Part1 = Instance.new("Part", fol)
- Part1.Size = Vector3.new(5,1,5)
- Part1.Material = "Neon"
- Part1.Anchored = true
- Part1.CFrame = Phoenix.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3,0)
- Part2 = Instance.new("Part", fol)
- Part2.Size = Vector3.new(5.05,1.05,5.05)
- Part2.Material = "Glass"
- Part2.Anchored = true
- Part2.CFrame = Phoenix.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3,0)
- Part2.Transparency = 0.5
- Part2.Color = BrickColor.new("Bright orange").Color
- Part2.Reflectance = 0.5
- game.Debris:AddItem(Part1,10)
- game.Debris:AddItem(Part2,10)
- number = 0
- spawn(function()
- for i = 1,9 do
- number = number + 5
- Part1 = Instance.new("Part", fol)
- Part1.Size = Vector3.new(5,1,5)
- Part1.Material = "Neon"
- Part1.Anchored = true
- Part1.CFrame = Phoenix.Character.HumanoidRootPart.CFrame * CFrame.new(math.random(-3,3),number,0-number)
- Part2 = Instance.new("Part", fol)
- Part2.Size = Vector3.new(5.05,1.05,5.05)
- Part2.Material = "Glass"
- Part2.Anchored = true
- Part2.CFrame = Part1.CFrame
- Part2.Transparency = 0.5
- Part2.Color = BrickColor.new("Bright orange").Color
- Part2.Reflectance = 0.5
- game.Debris:AddItem(Part1,10)
- game.Debris:AddItem(Part2,10)
- wait()
- end
- end)
- end
- Tool.Equipped:Connect(function()
- equipped = true
- end)
- Tool.Unequipped:Connect(function()
- equipped = false
- end)
- transforming = false
- Mouse.KeyDown:Connect(function(k)
- if k == "z" then
- if transforming == true then return end
- transforming = true
- anger = true
- stairs = false
- shield = false
- demolition = false
- spawn(function()
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(Color3.fromRGB(255,0,0),0.1)
- wait()
- end
- transforming = false
- end)
- elseif k == "x" then
- if transforming == true then return end
- transforming = true
- anger = false
- stairs = false
- shield = false
- demolition = true
- spawn(function()
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Dark indigo").Color,0.1)
- wait()
- end
- transforming = false
- end)
- elseif k == "c" then
- if transforming == true then return end
- transforming = true
- anger = false
- stairs = true
- shield = false
- demolition = false
- spawn(function()
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Bright orange").Color,0.1)
- wait()
- end
- transforming = false
- end)
- elseif k == "b" then
- if transforming == true then return end
- transforming = true
- anger = false
- stairs = false
- shield = false
- demolition = false
- spawn(function()
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Medium blue").Color,0.1)
- wait()
- end
- transforming = false
- end)
- elseif k == "v" then
- if transforming == true then return end
- transforming = true
- anger = false
- stairs = false
- shield = true
- demolition = false
- spawn(function()
- for i = 1,30 do
- GemShine.Color = GemShine.Color:Lerp(BrickColor.new("Lime green").Color,0.1)
- wait()
- end
- transforming = false
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement