Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by StarzoZero");InternalData = {}
- do
- script.Parent = owner.Character
- local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
- local function NewFakeEvent()
- local Bind = Instance.new("BindableEvent")
- local Fake;Fake = {Connections = {},
- fakeEvent=true;
- Connect=function(self,Func)
- Bind.Event:connect(Func)
- self.Connections[Bind] = true
- return setmetatable({Connected = true},{
- __index = function (self,Index)
- if Index:lower() == "disconnect" then
- return function() Fake.Connections[Bind] = false;self.Connected = false end
- end
- return Fake[Index]
- end;
- __tostring = function() return "Connection" end;
- })
- end}
- Fake.connect = Fake.Connect;return Fake;
- end
- local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
- local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
- local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
- self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
- end};ContextActionService.UnBindAction = ContextActionService.BindAction
- local function TriggerEvent(self,Event,...)
- local Trigger = Mouse[Event]
- if Trigger and Trigger.fakeEvent and Trigger.Connections then
- for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
- end
- end
- Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
- Event.OnServerEvent:Connect(function(FiredBy,Input)
- if FiredBy.Name ~= owner.Name then return end
- if Input.MouseEvent then
- Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
- else
- local Begin = Input.UserInputState == Enum.UserInputState.Begin
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
- for _,Action in pairs(ContextActionService.Actions) do
- for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
- end
- Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
- UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
- end
- end)
- InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
- Event.Parent = NLS([[
- local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
- local Input = function(Input,gameProcessedEvent)
- if gameProcessedEvent then return end
- Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
- end
- UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
- local Hit,Target
- while wait(1/30) do
- if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
- Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
- end
- end
- ]],owner.Character)
- end
- RealGame = game;game = setmetatable({},{
- __index = function (self,Index)
- local Sandbox = function (Thing)
- if Thing:IsA("Player") then
- local RealPlayer = Thing
- return setmetatable({},{
- __index = function (self,Index)
- local Type = type(RealPlayer[Index])
- if Type == "function" then
- if Index:lower() == "getmouse" or Index:lower() == "mouse" then
- return function (self)return InternalData["Mouse"] end
- end
- return function (self,...)return RealPlayer[Index](RealPlayer,...) end
- end
- return RealPlayer[Index]
- end;
- __tostring = function(self) return RealPlayer.Name end
- })
- end
- end
- if RealGame[Index] then
- local Type = type(RealGame[Index])
- if Type == "function" then
- if Index:lower() == "getservice" or Index:lower() == "service" then
- return function (self,Service)
- local FakeServices = {
- ["players"] = function()
- return setmetatable({},{
- __index = function (self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...)end
- else
- if Index2:lower() == "localplayer" then return Sandbox(owner) end
- return RealService[Index2]
- end
- end;
- __tostring = function(self) return RealGame:GetService(Service).Name end
- })
- end;
- ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
- ["userinputservice"] = function() return InternalData["UserInputService"] end;
- ["runservice"] = function()
- return setmetatable({},{
- __index = function(self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...) end
- else
- local RunServices = {
- ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
- ["renderstepped"] = function() return RealService["Stepped"] end
- }
- if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
- return RealService[Index2]
- end
- end
- })
- end
- }
- if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
- return RealGame:GetService(Service)
- end
- end
- return function (self,...) return RealGame[Index](RealGame,...) end
- else
- if game:GetService(Index) then return game:GetService(Index) end
- return RealGame[Index]
- end
- end
- return nil
- end
- });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("You monster.")
- mouse = game.Players.LocalPlayer:GetMouse()
- gun = Instance.new("Part", game.Players.LocalPlayer.Character)
- gun.Size = Vector3.new(0.5, 1, 2)
- gun.CanCollide = false
- gun:BreakJoints()
- weld = Instance.new("Weld", gun)
- weld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
- weld.Part1 = gun
- mesh = Instance.new("SpecialMesh", gun)
- mesh.MeshId = "rbxassetid://430056568"
- mesh.TextureId = "rbxassetid://430056584"
- portalmoosic = Instance.new("Sound", game.Players.LocalPlayer.Character)
- portalmoosic.SoundId = "rbxassetid://173064565"
- portalmoosic.Looped = true
- portalmoosic:Play()
- mesh.Scale = Vector3.new(0.17,0.17,0.17)
- weld.C0 = weld.C0 * CFrame.new(-0.2,-1.3,-0.8) * CFrame.Angles(3,0,0)
- local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
- rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
- rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
- rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- rhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
- lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
- lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
- lhandweld.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- lhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Pick = Instance.new("Sound", gun)
- Pick.SoundId = "rbxassetid://291256829"
- Pick:Play()
- Shoot = Instance.new("Sound", gun)
- Shoot.SoundId = "rbxassetid://142774034"
- blueexists = false
- tping = false
- orangeexists = false
- for i = 0,1 , 0.1 do
- wait()
- lhandweld.C0 = lhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,-0.2,-0.28),i)
- rhandweld.C0 = rhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,0.28),i)
- end
- for i = 0,1 , 0.1 do
- wait()
- lhandweld.C0 = lhandweld.C0 * CFrame.new():lerp(CFrame.new(0,-0.25,0),i)
- end
- using = false
- orange = false
- blue = true
- function changeportals(key)
- key = key:lower()
- if key == "q" then
- if not blue then
- blue = true
- orange = false
- end
- end
- if key == "e" then
- if not orange then
- blue = false
- orange = true
- end
- end
- end
- function portal()
- if not using then
- using = true
- if blue then
- Shoot:Play()
- local projectile = Instance.new("Part", workspace)
- projectile.Size = Vector3.new(1,1,1)
- projectile.BrickColor = BrickColor.new("Electric blue")
- projectile.Shape = "Ball"
- projectile.CanCollide = true
- projectile.Anchored = false
- projectile.Material = "Neon"
- local vel = Instance.new("BodyVelocity", projectile)
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Velocity = mouse.Hit.lookVector * 80
- projectile.Position = gun.CFrame.p
- wait(0.03)
- local function make(part)
- local gr = part.Parent:findFirstChild("Part")
- local porjectileposition = projectile.Position
- local portaldoor = Instance.new("Part", workspace)
- portaldoor.Size = Vector3.new(1, 1, 1)
- portaldoor.BrickColor = BrickColor.new("Electric blue")
- portaldoor.Anchored = true
- portaldoor.Shape = "Cylinder"
- portaldoor.Material = "Neon"
- portaldoor.CanCollide = false
- if blueexists == true then
- workspace.BluePortal:destroy()
- end
- blueexists = true
- portaldoor.Name = "BluePortal"
- portaldoor.CFrame = part.CFrame
- if part.Size.y < part.Size.x and part.Size.y < part.Size.z then --a big help from Toxsikkilla
- print("if y < x")
- portaldoor.CFrame = portaldoor.CFrame * CFrame.fromEulerAnglesXYZ(0,0,math.pi / 2)
- elseif part.Size.x < part.Size.y and part.Size.x < part.Size.z then
- print("if x < y")
- portaldoor.CFrame = portaldoor.CFrame * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
- elseif part.Size.z < part.Size.y and part.Size.z < part.Size.y then
- print("if z < y")
- portaldoor.CFrame = portaldoor.CFrame * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
- end
- portaldoor.Position = projectile.Position
- projectile:destroy()
- for i = 1,18 do
- portaldoor.Size = portaldoor.Size + Vector3.new(0,0.3,0.3)
- wait()
- end
- local function tp(part)
- local hum = part.Parent:findFirstChild("Humanoid")
- if hum ~= nil and blueexists and orangeexists and not tping then
- tping = true
- local tor = part.Parent:findFirstChild("Torso")
- if tor then
- local velocityoftorso = tor.Velocity
- local blport = workspace:findFirstChild("OrangePortal")
- if blport then
- tor.CFrame = workspace.OrangePortal.CFrame
- tor.Velocity = workspace.OrangePortal.CFrame.rightVector * -velocityoftorso * 1.7
- end
- end
- wait(0.3)
- tping = false
- end
- if not hum and blueexists and orangeexists and not tping then
- tping = true
- local cube = part.Parent:findFirstChild("Cube")
- if cube then
- tping = true
- local velocityoftorso = cube.Velocity
- cube.CFrame = workspace.OrangePortal.CFrame
- cube.Velocity = workspace.OrangePortal.CFrame.rightVector * -velocityoftorso * 1.7
- wait(0.3)
- tping = false
- end
- end
- wait(0.3)
- tping = false
- end
- portaldoor.Touched:connect(tp)
- end
- projectile.Touched:connect(make)
- end
- if orange then
- Shoot:Play()
- local projectile1 = Instance.new("Part", workspace)
- projectile1.Size = Vector3.new(1,1,1)
- projectile1.BrickColor = BrickColor.new("Deep orange")
- projectile1.Shape = "Ball"
- projectile1.CanCollide = true
- projectile1.Anchored = false
- projectile1.Material = "Neon"
- local vel1 = Instance.new("BodyVelocity", projectile1)
- vel1.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel1.Velocity = mouse.Hit.lookVector * 80
- projectile1.Position = gun.CFrame.p
- wait(0.03)
- local function make1(part)
- local gr = part.Parent:findFirstChild("Part")
- local portaldoor = Instance.new("Part", workspace)
- portaldoor.Size = Vector3.new(1, 1, 1)
- portaldoor.BrickColor = BrickColor.new("Deep orange")
- portaldoor.Anchored = true
- portaldoor.Material = "Neon"
- portaldoor.Shape = "Cylinder"
- portaldoor.CanCollide = false
- if orangeexists == true then
- workspace.OrangePortal:destroy()
- end
- portaldoor.CFrame = part.CFrame
- if part.Size.y < part.Size.x and part.Size.y < part.Size.z then --a big help from Toxsikkilla
- print("if y < x")
- portaldoor.CFrame = portaldoor.CFrame * CFrame.fromEulerAnglesXYZ(0,0,math.pi / 2)
- elseif part.Size.x < part.Size.y and part.Size.x < part.Size.z then
- print("if x < y")
- portaldoor.CFrame = portaldoor.CFrame * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
- elseif part.Size.z < part.Size.y and part.Size.z < part.Size.y then
- print("if z < y")
- portaldoor.CFrame = portaldoor.CFrame * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
- end
- portaldoor.Position = projectile1.Position
- projectile1:destroy()
- for i = 1,18 do
- portaldoor.Size = portaldoor.Size + Vector3.new(0,0.3,0.3)
- wait()
- end
- orangeexists = true
- portaldoor.Name = "OrangePortal"
- local function tp(part)
- local hum = part.Parent:findFirstChild("Humanoid")
- if hum ~= nil and blueexists and orangeexists and not tping then
- tping = true
- local tor = part.Parent:findFirstChild("Torso")
- if tor then
- local velocityoftorso = tor.Velocity
- local blport = workspace:findFirstChild("BluePortal")
- if blport then
- tor.CFrame = workspace.BluePortal.CFrame
- tor.Velocity = workspace.BluePortal.CFrame.rightVector * -velocityoftorso * 1.7
- end
- end
- wait(0.3)
- tping = false
- end
- if not hum and blueexists and orangeexists and not tping then
- tping = true
- local cube = part.Parent:findFirstChild("Cube")
- if cube then
- tping = true
- local velocityoftorso = cube.Velocity
- local blport = workspace:findFirstChild("BluePortal")
- if velocityoftorso.y < velocityoftorso.z and velocityoftorso.y < velocityoftorso.x then
- cube.Velocity = -velocityoftorso * 1.5
- if blport then
- cube.CFrame = workspace.BluePortal.rightVector * -velocityoftorso * 1.7
- end
- end
- wait(0.3)
- tping = false
- end
- wait(0.3)
- tping = false
- end
- wait(0.3)
- tping = false
- end
- portaldoor.Touched:connect(tp)
- end
- projectile1.Touched:connect(make1)
- end
- for i = 0,1 , 0.3 do
- wait()
- lhandweld.C0 = lhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,-0.2),i)
- rhandweld.C0 = rhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,0.2),i)
- end
- for i = 0,1 , 0.3 do
- wait()
- lhandweld.C0 = lhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,0.2),i)
- rhandweld.C0 = rhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,-0.2),i)
- end
- using = false
- end
- end
- function remove(key)
- key = key:lower()
- if key == "r" then
- if blueexists or orangeexists or blueexists and orangeexists then
- workspace.OrangePortal:destroy()
- workspace.BluePortal:destroy()
- orangeexists = false
- blueexists = false
- end
- end
- end
- cubesp = false
- function cubespawn(key)
- key = key:lower()
- if key == "c" then
- if cubesp then
- workspace.Cube:destroy()
- end
- cubesp = true
- local coobe = Instance.new("Part", workspace)
- coobe.Size = Vector3.new(2.774, 2.834, 2.804)
- coobe:BreakJoints()
- coobe.Position = game.Players.LocalPlayer.Character.Torso.Position
- coobe.Name = "Cube"
- local meh = Instance.new("SpecialMesh", coobe)
- meh.MeshId = "rbxassetid://464957313"
- meh.TextureId = "rbxassetid://464957325"
- meh.Scale = Vector3.new(0.8,0.8,0.8)
- local function sounds()
- if not impacting then
- impacting = true
- local impactspeed = math.random(0.9,1.1)
- impact.PlaybackSpeed = impactspeed
- wait(0.2)
- impacting = false
- end
- end
- coobe.Touched:connect(sounds)
- end
- end
- function deleterportalsondedth()
- if orangeexists or blueexists or blueexists and orangeexists then
- workspace.OrangePortal:destroy()
- workspace.BluePortal:destroy()
- if cubesp then
- workspace.Cube:destroy()
- end
- end
- end
- game.Players.LocalPlayer.Character.Humanoid.Died:connect(deleterportalsondedth)
- mouse.KeyDown:connect(cubespawn)
- mouse.Button1Down:connect(portal)
- mouse.KeyDown:connect(changeportals)
- mouse.KeyDown:connect(remove)
Add Comment
Please, Sign In to add comment