Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- --By Rufus14
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Weld6 = Instance.new("Weld")
- LocalScript7 = Instance.new("LocalScript")
- RemoteEvent8 = Instance.new("RemoteEvent")
- Script9 = Instance.new("Script")
- Part10 = Instance.new("Part")
- Tool0.Name = "Portal Gun"
- Tool0.Parent = mas
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(5.81662703, 0.500005007, -3.48566008, 1, 0, -0, 0, 0, 1, 0, -1, 0)
- Part1.Orientation = Vector3.new(-90, 0, 0)
- Part1.Position = Vector3.new(5.81662703, 0.500005007, -3.48566008)
- Part1.Rotation = Vector3.new(-90, 0, 0)
- Part1.Size = Vector3.new(1, 2.5, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "rbxassetid://445285256"
- SpecialMesh2.Scale = Vector3.new(0.150000006, 0.150000006, 0.150000006)
- SpecialMesh2.TextureId = "rbxassetid://445285268"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- Sound3.Name = "Blue"
- Sound3.Parent = Part1
- Sound3.SoundId = "rbxassetid://182981554"
- Sound4.Name = "Orange"
- Sound4.Parent = Part1
- Sound4.SoundId = "rbxassetid://142774034"
- Sound5.Name = "Invalid"
- Sound5.Parent = Part1
- Sound5.SoundId = "rbxassetid://182981577"
- Weld6.Parent = Part1
- Weld6.C0 = CFrame.new(0.196903229, -0.78666687, 0.0808101892, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- Weld6.Part0 = Part1
- Weld6.Part1 = Part10
- Weld6.part1 = Part10
- LocalScript7.Name = "portallocal"
- LocalScript7.Parent = Tool0
- table.insert(cors,sandbox(LocalScript7,function()
- --By Rufus14
- local owner
- local character
- local rootpart
- local charhum
- mouse = game:GetService("Players").LocalPlayer:GetMouse()
- equipped = false
- canshoot = true
- grabbingwho = nil
- runservice = game:GetService("RunService")
- tool = script.Parent
- handle = tool.Handle
- remote = tool:WaitForChild("portal")
- bluesound = handle.Blue
- orangesound = handle.Orange
- invalid = handle.Invalid
- zoffset = 0
- yoffset = 0
- xoffset = 0
- xrotoffset = 0
- yrotoffset = 0
- zrotoffset = 0
- xrotoffsetportal = 0
- yrotoffsetportal = 0
- zrotoffsetportal = 0
- tool.Unequipped:connect(function()
- equipped = false
- charhum.AutoRotate = true
- if character["Right Arm"]:findFirstChild("RightGriplocal") then
- character["Right Arm"]:findFirstChild("RightGriplocal"):destroy()
- end
- if character.Torso:findFirstChild("LeftArmWeldportallocal") then
- character.Torso:findFirstChild("LeftArmWeldportallocal"):destroy()
- end
- if character.Torso:findFirstChild("RightArmWeldportallocal") then
- character.Torso:findFirstChild("RightArmWeldportallocal"):destroy()
- end
- if character.Torso:findFirstChild("HeadWeldportallocal") then
- character.Torso:findFirstChild("HeadWeldportallocal"):destroy()
- end
- if character:findFirstChild("HumanoidRootPart") then
- if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldportallocal") then
- character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldportallocal"):destroy()
- end
- end
- end)
- orangeshot = false
- mouse.KeyDown:connect(function(key)
- if not equipped then return end
- key = key:lower()
- if key == "r" then
- remote:FireServer("closeportals")
- for i = 1,20 do
- yrotoffsetportal = math.sin(i/2)/8
- runservice.RenderStepped:wait()
- end
- yrotoffsetportal = 0
- elseif key == "e" then
- if grabbingwho == nil then
- local ray = Ray.new(character.Head.Position, character.Head.CFrame.lookVector*7)
- local hitray, hitposition = workspace:FindPartOnRayWithIgnoreList(ray, {character})
- if hitray then
- if not hitray.Anchored then
- grabbingwho = hitray
- canshoot = false
- remote:FireServer("grab", hitray)
- coroutine.wrap(function()
- while runservice.RenderStepped:wait() do
- if grabbingwho ~= nil then
- grabbingwho.Velocity = Vector3.new()
- grabbingwho.CFrame = grabbingwho.CFrame:lerp(character.Head.CFrame * CFrame.new(0,0,-7), 0.1)
- end
- end
- end)()
- end
- end
- else
- grabbingwho = nil
- remote:FireServer("grab")
- for i = 1,20 do
- yrotoffsetportal = math.sin(i/2)/8
- runservice.RenderStepped:wait()
- end
- yrotoffsetportal = 0
- canshoot = true
- end
- end
- end)
- mouse.Button1Down:connect(function()
- if equipped and canshoot then
- remote:FireServer("shootblue", handle.CFrame, mouse.Hit)
- for i = 1,10 do
- zoffset = math.cos(i/12)/1.5
- xrotoffset = math.cos(i/12)/5
- runservice.RenderStepped:wait()
- end
- xrotoffset = 0
- zoffset = 0
- end
- end)
- mouse.Button2Down:connect(function()
- orangeshot = true
- coroutine.wrap(function()
- if orangeshot then
- wait(0.1)
- orangeshot = false
- end
- end)()
- end)
- mouse.Button2Up:connect(function()
- if equipped and canshoot then
- if orangeshot then
- remote:FireServer("shootorange", handle.CFrame, mouse.Hit)
- for i = 1,10 do
- zoffset = math.cos(i/12)/1.5
- xrotoffset = math.cos(i/12)/5
- runservice.RenderStepped:wait()
- end
- xrotoffset = 0
- zoffset = 0
- end
- end
- end)
- tool.Equipped:connect(function()
- equipped = true
- owner = game:GetService("Players").LocalPlayer
- character = owner.Character
- charhum = character:findFirstChildOfClass("Humanoid")
- charhum.AutoRotate = false
- rootpart = character.HumanoidRootPart
- mouse = owner:GetMouse()
- character["Right Arm"]:WaitForChild("RightGrip")
- local fakegrip = Instance.new("Weld", character["Right Arm"])
- fakegrip.Part0 = character["Right Arm"]
- fakegrip.Part1 = handle
- fakegrip.Name = "RightGriplocal"
- fakegrip.C0 = CFrame.new(0.0172424316, -1.10172808, -0.631057739, 0.939694643, 0.342014611, 1.5361735e-06, 0.336815238, -0.925408483, -0.173644245, -0.0593881048, 0.163174912, -0.984808147)
- local rightarm = Instance.new("Weld", character.Torso)
- rightarm.Part0 = character.Torso
- rightarm.Part1 = character["Right Arm"]
- rightarm.C0 = CFrame.new(1.5,0,0)
- rightarm.Name = "RightArmWeldportallocal"
- local leftarm = Instance.new("Weld", character.Torso)
- leftarm.Part0 = character.Torso
- leftarm.Part1 = character["Left Arm"]
- leftarm.C0 = CFrame.new(-1.5,0,0)
- leftarm.Name = "LeftArmWeldportallocal"
- local head = Instance.new("Weld", character.Torso)
- head.Part0 = character.Torso
- head.Part1 = character.Head
- head.C0 = CFrame.new(0,1.5,0)
- head.Name = "HeadWeldportallocal"
- local humanoidrootpart = Instance.new("Weld", rootpart)
- humanoidrootpart.Part0 = rootpart
- humanoidrootpart.Part1 = character.Torso
- humanoidrootpart.Name = "HumanoidRootPartWeldportallocal"
- coroutine.wrap(function()
- while wait() and equipped do --send c0
- remote:FireServer("updatec0", "RightGrip", fakegrip.C0)
- remote:FireServer("updatec0", "HeadWeldportal", head.C0)
- remote:FireServer("updatec0", "HumanoidRootPartWeldportal", humanoidrootpart.C0)
- remote:FireServer("updatec0", "LeftArmWeldportal", leftarm.C0)
- remote:FireServer("updatec0", "RightArmWeldportal", rightarm.C0)
- end
- end)()
- coroutine.wrap(function()
- while runservice.RenderStepped:wait() and equipped do
- if rootpart.Velocity.x >= 2 or rootpart.Velocity.x <= -2 or rootpart.Velocity.z >= 2 or rootpart.Velocity.z <= -2 then
- xoffset = math.sin(tick()*5)/10
- yoffset = math.sin(tick()*10)/10
- elseif rootpart.Velocity.x <= 2 or rootpart.Velocity.x >= -2 or rootpart.Velocity.z <= 2 or rootpart.Velocity.z >= -2 then
- xoffset = 0
- yoffset = math.sin(tick())/20
- --print("standing")
- end
- end
- end)()
- coroutine.wrap(function()
- while runservice.RenderStepped:wait() and equipped do
- character["Left Arm"].LocalTransparencyModifier = 0
- character["Right Arm"].LocalTransparencyModifier = 0
- for q,w in pairs(character.Head:GetDescendants()) do
- if w.Name == "NoPortal" or w.Name == "BluePortal" or w.Name == "OrangePortal" or w.Name == "pellet" then
- w.LocalTransparencyModifier = 0
- end
- end
- if (workspace.CurrentCamera.CFrame.p - character.Head.CFrame.p).magnitude <= 1.5 then
- charhum.CameraOffset = Vector3.new(0,0.5,0)
- else
- charhum.CameraOffset = Vector3.new(0,0,0)
- end
- local absvel = rootpart.CFrame:vectorToObjectSpace(rootpart.Velocity)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(absvel.z/120,0,-absvel.x/120),0.1)
- if not charhum.PlatformStand then
- rootpart.CFrame = rootpart.CFrame:lerp(CFrame.new(rootpart.Position, Vector3.new(mouse.Hit.p.x,rootpart.Position.y,mouse.Hit.p.z)),0.2)
- else
- charhum.PlatformStand = false
- end
- fakegrip.C0 = fakegrip.C0:lerp(CFrame.new(0.0172424316, -1.10172808, -0.631057739, 0.939694643, 0.342014611, 1.5361735e-06, 0.336815238, -0.925408483, -0.173644245, -0.0593881048, 0.163174912, -0.984808147) * CFrame.fromEulerAnglesXYZ(xrotoffsetportal,yrotoffsetportal,zrotoffsetportal),0.2)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(((mouse.Hit.p-mouse.Origin.p).unit.y),0,0) * CFrame.new(0,0.5,0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-0.3+xoffset,-0.3+yoffset,-0.5+zoffset) * CFrame.fromEulerAnglesXYZ((((mouse.Hit.p-mouse.Origin.p).unit.y)+math.pi/2)+xrotoffset,yrotoffset,math.rad(30)+zrotoffset) * CFrame.new(0,-1,-0.5),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1+xoffset,0+yoffset,-0.3+zoffset) * CFrame.fromEulerAnglesXYZ((((mouse.Hit.p-mouse.Origin.p).unit.y)+math.pi/2)+xrotoffset,yrotoffset,math.rad(-20)+zrotoffset) * CFrame.new(0,-0.5,-0.5),0.2)
- end
- character["Left Arm"].LocalTransparencyModifier = 0
- character["Right Arm"].LocalTransparencyModifier = 0
- charhum.CameraOffset = Vector3.new(0,0,0)
- end)()
- end)
- end))
- RemoteEvent8.Name = "portal"
- RemoteEvent8.Parent = Tool0
- Script9.Name = "portalserver"
- Script9.Parent = Tool0
- table.insert(cors,sandbox(Script9,function()
- --By Rufus14
- local owner
- local character
- equipped = false
- canshoot = true
- grabbing = false
- tool = script.Parent
- handle = tool.Handle
- remote = tool.portal
- runservice = game:GetService("RunService")
- bluesound = handle.Blue
- orangesound = handle.Orange
- invalid = handle.Invalid
- light = tool.Light
- illegalmaterial = {Enum.Material.WoodPlanks, Enum.Material.CorrodedMetal, Enum.Material.Grass, Enum.Material.Brick, Enum.Material.Cobblestone, Enum.Material.ForceField, Enum.Material.Fabric}
- tool.Equipped:connect(function()
- equipped = true
- owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
- character = owner.Character
- local rightarm = Instance.new("Weld", character.Torso)
- rightarm.Part0 = character.Torso
- rightarm.Part1 = character["Right Arm"]
- rightarm.C0 = CFrame.new(1.5,0,0)
- rightarm.Name = "RightArmWeldportal"
- local leftarm = Instance.new("Weld", character.Torso)
- leftarm.Part0 = character.Torso
- leftarm.Part1 = character["Left Arm"]
- leftarm.C0 = CFrame.new(-1.5,0,0)
- leftarm.Name = "LeftArmWeldportal"
- local head = Instance.new("Weld", character.Torso)
- head.Part0 = character.Torso
- head.Part1 = character.Head
- head.C0 = CFrame.new(0,1.5,0)
- head.Name = "HeadWeldportal"
- local humanoidrootpart = Instance.new("Weld", character.HumanoidRootPart)
- humanoidrootpart.Part0 = character.HumanoidRootPart
- humanoidrootpart.Part1 = character.Torso
- humanoidrootpart.Name = "HumanoidRootPartWeldportal"
- end)
- tool.Unequipped:connect(function()
- equipped = false
- if character.Torso:findFirstChild("LeftArmWeldportal") then
- character.Torso:findFirstChild("LeftArmWeldportal"):destroy()
- end
- if character.Torso:findFirstChild("RightArmWeldportal") then
- character.Torso:findFirstChild("RightArmWeldportal"):destroy()
- end
- if character.Torso:findFirstChild("HeadWeldportal") then
- character.Torso:findFirstChild("HeadWeldportal"):destroy()
- end
- if character:findFirstChild("HumanoidRootPart") then
- if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldportal") then
- character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldportal"):destroy()
- end
- end
- end)
- remote.OnServerEvent:connect(function(plr, what, value, value2)
- if plr ~= owner then return end
- --
- if what == "updatec0" then
- for i,v in pairs(character:GetDescendants()) do
- if v.Name == value then
- v.C0 = value2
- end
- end
- elseif what == "grab" then
- if not grabbing then
- grabbing = true
- light.Transparency = 0
- light.BrickColor = BrickColor.new("Institutional white")
- for q,w in pairs(value:GetDescendants()) do
- if w.ClassName == "Part" or w.ClassName == "MeshPart" then
- w.Anchored = false
- end
- end
- value:SetNetworkOwner(owner)
- local wentthh = Instance.new("BoolValue", value)
- wentthh.Name = "wentthroughportal"
- coroutine.wrap(function()
- while grabbing do runservice.Stepped:wait() end
- wentthh:destroy()
- value:SetNetworkOwner(nil)
- end)()
- else
- light.Transparency = 1
- grabbing = false
- end
- elseif what == "closeportals" then
- light.Transparency = 1
- if character.Head:findFirstChild("BluePortal") then
- local blu = character.Head:findFirstChild("BluePortal")
- local soundpart = Instance.new("UnionOperation", character.Head)
- soundpart.Transparency = 1
- soundpart.CanCollide = false
- soundpart.CFrame = blu.CFrame
- soundpart.Anchored = true
- local soundclose = Instance.new("Sound", soundpart)
- soundclose.SoundId = "rbxassetid://182981587"
- soundclose.Volume = 1
- soundclose:Play()
- game.Debris:AddItem(soundpart, soundclose.TimeLength)
- coroutine.wrap(function()
- for i = 1,10 do
- blu.Size = blu.Size - Vector3.new(0.35,0.5,0)
- runservice.Stepped:wait()
- end
- blu:destroy()
- end)()
- end
- if character.Head:findFirstChild("OrangePortal") then
- local orang = character.Head:findFirstChild("OrangePortal")
- local soundpart = Instance.new("UnionOperation", character.Head)
- soundpart.Transparency = 1
- soundpart.CanCollide = false
- soundpart.CFrame = orang.CFrame
- soundpart.Anchored = true
- local soundclose = Instance.new("Sound", soundpart)
- soundclose.SoundId = "rbxassetid://182981587"
- soundclose.Volume = 1
- soundclose:Play()
- game.Debris:AddItem(soundpart, soundclose.TimeLength)
- coroutine.wrap(function()
- for i = 1,10 do
- orang.Size = orang.Size - Vector3.new(0.35,0.5,0)
- runservice.Stepped:wait()
- end
- orang:destroy()
- end)()
- end
- elseif what == "shootblue" then
- bluesound.PlaybackSpeed = 1+(math.random(-20,20)/120)
- bluesound:Play()
- light.Transparency = 0
- light.BrickColor = BrickColor.new("Toothpaste")
- local pellet = Instance.new("Part", character.Head)
- pellet.Size = Vector3.new(0.7,0.7,1.7)
- pellet.Name = "pellet"
- pellet.Material = "Neon"
- pellet.BrickColor = BrickColor.new("Toothpaste")
- pellet.CFrame = value * CFrame.new(0,2,0)
- pellet.CFrame = CFrame.new(pellet.Position, value2.p)
- pellet.CanCollide = false
- pellet.Anchored = true
- Instance.new("PointLight", pellet).Brightness = 4
- local mesh = Instance.new("SpecialMesh", pellet)
- mesh.MeshType = "Sphere"
- local hitwall = false
- local ignorelist = {}
- for i,v in pairs(workspace:GetDescendants()) do
- if v.ClassName == "Model" then
- if v:findFirstChildOfClass("Humanoid") then
- table.insert(ignorelist, v)
- end
- end
- end
- local function awman()
- invalid:Play()
- invalid.PlaybackSpeed = 1+(math.random(-20,20)/120)
- local boom = Instance.new("Part", character.Head)
- boom.CanCollide = false
- boom.Anchored = false
- boom.Shape = "Ball"
- boom.Name = "NoPortal"
- boom.Anchored = true
- boom.Material = "Neon"
- boom.CFrame = pellet.CFrame
- coroutine.wrap(function()
- for i = 1,10 do
- boom.Size = boom.Size + Vector3.new(0.15,0.15,0.15)
- boom.Transparency = boom.Transparency + 0.1
- runservice.Stepped:wait()
- end
- boom:Destroy()
- end)()
- for i = 1,math.random(4,10) do
- local laser = Instance.new("UnionOperation", character.Head)
- Instance.new("BlockMesh", laser)
- laser.BrickColor = BrickColor.new("Toothpaste")
- laser.Anchored = true
- laser.Material = "Neon"
- laser.Name = "NoPortal"
- laser.Size = Vector3.new(0.1,0.1,1)
- laser.CanCollide = false
- laser.CFrame = pellet.CFrame
- laser.CFrame = laser.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-10,10)/1.5,math.random(-10,10)/1.5,math.random(-10,10)/1.5)
- coroutine.wrap(function()
- for i = 1,20 do
- laser.Transparency = laser.Transparency + 0.05
- laser.CFrame = laser.CFrame * CFrame.new(0,0,-0.1)
- runservice.Stepped:wait()
- end
- laser:destroy()
- end)()
- end
- pellet:destroy()
- end
- coroutine.wrap(function()
- local threshold = 0
- while runservice.Stepped:wait() and not hitwall do
- local ray = Ray.new(pellet.Position, pellet.CFrame.lookVector*8)
- local rayhit, raypos, raysurface = workspace:FindPartOnRayWithIgnoreList(ray, ignorelist)
- if rayhit then
- if rayhit.Name ~= "NoPortal" then
- hitwall = true
- if rayhit.Name == "OrangePortal" then
- awman()
- return
- end
- for i,v in pairs(illegalmaterial) do
- if v == rayhit.Material then
- awman()
- return
- end
- end
- if character.Head:findFirstChild("BluePortal") then
- character.Head.BluePortal:destroy()
- end
- local portal = Instance.new("UnionOperation", character.Head)
- local mesh = Instance.new("SpecialMesh", portal)
- mesh.MeshType = "Sphere"
- portal.Size = Vector3.new(1,1,0.4)
- portal.Name = "BluePortal"
- portal.BrickColor = BrickColor.new("Toothpaste")
- portal.Material = "Neon"
- portal.CanCollide = false
- portal.Anchored = true
- portal.CFrame = CFrame.new(raypos, raypos-raysurface)
- coroutine.wrap(function()
- for i = 1,10 do
- portal.Size = portal.Size + Vector3.new(0.35,0.5,0)
- runservice.Stepped:wait()
- end
- end)()
- local portalopen = Instance.new("Sound", portal)
- portalopen.SoundId = "rbxassetid://171399373"
- portalopen.Volume = 1.5
- portalopen.PlaybackSpeed = 1+(math.random(-20,20)/120)
- portalopen:Play()
- local portalidle = Instance.new("Sound", portal)
- portalidle.SoundId = "rbxassetid://148894502"
- portalidle.Volume = 0.25
- portalidle:Play()
- portalidle.Looped = true
- local gothroughsound = Instance.new("Sound", portal)
- gothroughsound.Volume = 3
- game.Debris:AddItem(portalopen, portalopen.TimeLength)
- portal.Touched:connect(function(part)
- if part.Anchored then return end
- gothroughsound.PlaybackSpeed = 1+(math.random(-20,20)/120)
- if part.Parent.ClassName == "Accessory" or part.Parent.ClassName == "Hat" or part.Parent.ClassName == "Tool" then
- if part.Parent.Parent ~= workspace then
- --print("ignored hat on player")
- return
- end
- end
- if character.Head:findFirstChild("OrangePortal") then
- local humus = part.Parent:findFirstChildOfClass("Humanoid")
- if humus then
- local head = part.Parent:findFirstChild("Head")
- if head then
- local wentthrough = part.Parent:findFirstChild("wentthroughportal")
- --[[if wentthrough then
- print("returned from head tp")
- return
- end--]]
- if not wentthrough then
- local wentth = Instance.new("BoolValue", part.Parent)
- wentth.Name = "wentthroughportal"
- game.Debris:AddItem(wentth, 0.4)
- local headvelocity = head.Velocity
- if headvelocity.y < -50 or headvelocity.y > 50 or headvelocity.z < -50 or headvelocity.z > 50 or headvelocity.x < -50 or headvelocity.x > 50 then
- gothroughsound.SoundId = "rbxassetid://2769872789"
- else
- gothroughsound.SoundId = "rbxassetid://232806289"
- end
- gothroughsound:Play()
- head.CFrame = character.Head.OrangePortal.CFrame * CFrame.new(0,2,4)
- local px,py,pz = character.Head.OrangePortal.CFrame:toEulerAnglesXYZ()
- head.CFrame = CFrame.new(head.Position) * CFrame.fromEulerAnglesXYZ(0,py,0)
- local pushv = Instance.new("BodyVelocity", head)
- pushv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- pushv.Velocity = character.Head.OrangePortal.CFrame.lookVector * (-15 + headvelocity.y/1.2)
- humus:ChangeState(Enum.HumanoidStateType.GettingUp)
- game.Debris:AddItem(pushv, 0.2)
- end
- else
- local wentthrough = part:findFirstChild("wentthroughportal")
- --[[if wentthrough then
- print("returned from humanoid part tp")
- return
- end--]]
- if not wentthrough then
- local wentth = Instance.new("BoolValue", part)
- wentth.Name = "wentthroughportal"
- game.Debris:AddItem(wentth, 0.4)
- local partvelocity = part.Velocity
- if partvelocity.y < -50 or partvelocity.y > 50 or partvelocity.z < -50 or partvelocity.z > 50 or partvelocity.x < -50 or partvelocity.x > 50 then
- gothroughsound.SoundId = "rbxassetid://2769872789"
- else
- gothroughsound.SoundId = "rbxassetid://232806289"
- end
- gothroughsound:Play()
- part.CFrame = character.Head.OrangePortal.CFrame * CFrame.new(0,2,4)
- local pushv = Instance.new("BodyVelocity", part)
- pushv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- pushv.Velocity = character.Head.OrangePortal.CFrame.lookVector * (-15 + partvelocity.y/1.2)
- game.Debris:AddItem(pushv, 0.2)
- end
- end
- else
- local wentthrough = part:findFirstChild("wentthroughportal")
- --[[if wentthrough then
- print("returned from part tp")
- return
- end--]]
- if not wentthrough then
- local wentth = Instance.new("BoolValue", part)
- wentth.Name = "wentthroughportal"
- game.Debris:AddItem(wentth, 0.4)
- local partvelocity = part.Velocity
- if partvelocity.y < -50 or partvelocity.y > 50 or partvelocity.z < -50 or partvelocity.z > 50 or partvelocity.x < -50 or partvelocity.x > 50 then
- gothroughsound.SoundId = "rbxassetid://2769872789"
- else
- gothroughsound.SoundId = "rbxassetid://232806289"
- end
- gothroughsound:Play()
- part.CFrame = character.Head.OrangePortal.CFrame * CFrame.new(0,2,4)
- local pushv = Instance.new("BodyVelocity", part)
- pushv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- pushv.Velocity = character.Head.OrangePortal.CFrame.lookVector * (-15 + partvelocity.y/1.2)
- game.Debris:AddItem(pushv, 0.2)
- end
- end
- end
- end)
- else
- awman()
- end
- end
- pellet.CFrame = pellet.CFrame * CFrame.new(0,0,-8)
- threshold = threshold + 1
- if threshold == 200 then
- pellet:destroy()
- break
- end
- end
- pellet:destroy()
- end)()
- elseif what == "shootorange" then
- orangesound.PlaybackSpeed = 1+(math.random(-20,20)/120)
- orangesound:Play()
- light.Transparency = 0
- light.BrickColor = BrickColor.new("Deep orange")
- local pellet = Instance.new("Part", character.Head)
- pellet.Size = Vector3.new(0.7,0.7,1.7)
- pellet.Material = "Neon"
- pellet.Name = "pellet"
- pellet.BrickColor = BrickColor.new("Deep orange")
- pellet.CFrame = value * CFrame.new(0,2,0)
- pellet.CFrame = CFrame.new(pellet.Position, value2.p)
- pellet.CanCollide = false
- pellet.Anchored = true
- Instance.new("PointLight", pellet).Brightness = 4
- local mesh = Instance.new("SpecialMesh", pellet)
- mesh.MeshType = "Sphere"
- local hitwall = false
- local ignorelist = {}
- for i,v in pairs(workspace:GetDescendants()) do
- if v.ClassName == "Model" then
- if v:findFirstChildOfClass("Humanoid") then
- table.insert(ignorelist, v)
- end
- end
- end
- local function awman()
- invalid:Play()
- invalid.PlaybackSpeed = 1+(math.random(-20,20)/120)
- local boom = Instance.new("Part", character.Head)
- boom.CanCollide = false
- boom.Anchored = true
- boom.Shape = "Ball"
- boom.Name = "NoPortal"
- boom.Material = "Neon"
- boom.CFrame = pellet.CFrame
- coroutine.wrap(function()
- for i = 1,10 do
- boom.Size = boom.Size + Vector3.new(0.15,0.15,0.15)
- boom.Transparency = boom.Transparency + 0.1
- runservice.Stepped:wait()
- end
- boom:Destroy()
- end)()
- for i = 1,math.random(4,10) do
- local laser = Instance.new("UnionOperation", character.Head)
- Instance.new("BlockMesh", laser)
- laser.BrickColor = BrickColor.new("Deep orange")
- laser.Size = Vector3.new(0.1,0.1,1)
- laser.Anchored = true
- laser.Material = "Neon"
- laser.Name = "NoPortal"
- laser.CanCollide = false
- laser.CFrame = pellet.CFrame
- laser.CFrame = laser.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-10,10)/1.5,math.random(-10,10)/1.5,math.random(-10,10)/1.5)
- coroutine.wrap(function()
- for i = 1,20 do
- laser.Transparency = laser.Transparency + 0.05
- laser.CFrame = laser.CFrame * CFrame.new(0,0,-0.1)
- runservice.Stepped:wait()
- end
- laser:destroy()
- end)()
- end
- pellet:destroy()
- end
- coroutine.wrap(function()
- local threshold = 0
- while runservice.Stepped:wait() and not hitwall do
- local ray = Ray.new(pellet.Position, pellet.CFrame.lookVector*8)
- local rayhit, raypos, raysurface = workspace:FindPartOnRayWithIgnoreList(ray, ignorelist)
- if rayhit then
- if rayhit.Name ~= "NoPortal" then
- hitwall = true
- if rayhit.Name == "BluePortal" then
- awman()
- return
- end
- for i,v in pairs(illegalmaterial) do
- if v == rayhit.Material then
- awman()
- return
- end
- end
- if character.Head:findFirstChild("OrangePortal") then
- character.Head.OrangePortal:destroy()
- end
- local portal = Instance.new("UnionOperation", character.Head)
- local mesh = Instance.new("SpecialMesh", portal)
- mesh.MeshType = "Sphere"
- portal.Size = Vector3.new(1,1,0.4)
- portal.Name = "OrangePortal"
- portal.BrickColor = BrickColor.new("Deep orange")
- portal.Material = "Neon"
- portal.CanCollide = false
- portal.Anchored = true
- portal.CFrame = CFrame.new(raypos, raypos-raysurface)
- coroutine.wrap(function()
- for i = 1,10 do
- portal.Size = portal.Size + Vector3.new(0.35,0.5,0)
- runservice.Stepped:wait()
- end
- end)()
- local portalopen = Instance.new("Sound", portal)
- portalopen.SoundId = "rbxassetid://171399373"
- portalopen.Volume = 1.5
- portalopen.PlaybackSpeed = 1+(math.random(-20,20)/120)
- portalopen:Play()
- local portalidle = Instance.new("Sound", portal)
- portalidle.SoundId = "rbxassetid://148894502"
- portalidle.Volume = 0.25
- portalidle:Play()
- portalidle.Looped = true
- local gothroughsound = Instance.new("Sound", portal)
- gothroughsound.Volume = 1.5
- game.Debris:AddItem(portalopen, portalopen.TimeLength)
- portal.Touched:connect(function(part)
- if part.Anchored then return end
- gothroughsound.PlaybackSpeed = 1+(math.random(-20,20)/120)
- if part.Parent.ClassName == "Accessory" or part.Parent.ClassName == "Hat" or part.Parent.ClassName == "Tool" then
- if part.Parent.Parent ~= workspace then
- --print("ignored hat on player")
- return
- end
- end
- if character.Head:findFirstChild("BluePortal") then
- local humus = part.Parent:findFirstChildOfClass("Humanoid")
- if humus then
- local head = part.Parent:findFirstChild("Head")
- if head then
- local wentthrough = part.Parent:findFirstChild("wentthroughportal")
- --[[if wentthrough then
- print("returned from head tp")
- return
- end--]]
- if not wentthrough then
- local wentth = Instance.new("BoolValue", part.Parent)
- wentth.Name = "wentthroughportal"
- game.Debris:AddItem(wentth, 0.4)
- local headvelocity = head.Velocity
- if headvelocity.y < -50 or headvelocity.y > 50 or headvelocity.z < -50 or headvelocity.z > 50 or headvelocity.x < -50 or headvelocity.x > 50 then
- gothroughsound.SoundId = "rbxassetid://2769872789"
- else
- gothroughsound.SoundId = "rbxassetid://232806289"
- end
- gothroughsound:Play()
- head.CFrame = character.Head.BluePortal.CFrame * CFrame.new(0,2,4)
- local px,py,pz = character.Head.BluePortal.CFrame:toEulerAnglesXYZ()
- head.CFrame = CFrame.new(head.Position) * CFrame.fromEulerAnglesXYZ(0,py,0)
- local pushv = Instance.new("BodyVelocity", head)
- pushv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- pushv.Velocity = character.Head.BluePortal.CFrame.lookVector * (-15 + headvelocity.y/1.2)
- humus:ChangeState(Enum.HumanoidStateType.GettingUp)
- game.Debris:AddItem(pushv, 0.2)
- end
- else
- local wentthrough = part:findFirstChild("wentthroughportal")
- --[[if wentthrough then
- print("returned from humanoid part tp")
- return
- end--]]
- if not wentthrough then
- local wentth = Instance.new("BoolValue", part)
- wentth.Name = "wentthroughportal"
- game.Debris:AddItem(wentth, 0.4)
- local partvelocity = part.Velocity
- if partvelocity.y < -50 or partvelocity.y > 50 or partvelocity.z < -50 or partvelocity.z > 50 or partvelocity.x < -50 or partvelocity.x > 50 then
- gothroughsound.SoundId = "rbxassetid://2769872789"
- else
- gothroughsound.SoundId = "rbxassetid://232806289"
- end
- gothroughsound:Play()
- part.CFrame = character.Head.BluePortal.CFrame * CFrame.new(0,2,4)
- local pushv = Instance.new("BodyVelocity", part)
- pushv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- pushv.Velocity = character.Head.BluePortal.CFrame.lookVector * (-15 + partvelocity.y/1.2)
- game.Debris:AddItem(pushv, 0.2)
- end
- end
- else
- local wentthrough = part:findFirstChild("wentthroughportal")
- --[[if wentthrough then
- print("returned from part tp")
- return
- end--]]
- if not wentthrough then
- local wentth = Instance.new("BoolValue", part)
- wentth.Name = "wentthroughportal"
- game.Debris:AddItem(wentth, 0.4)
- local partvelocity = part.Velocity
- if partvelocity.y < -50 or partvelocity.y > 50 or partvelocity.z < -50 or partvelocity.z > 50 or partvelocity.x < -50 or partvelocity.x > 50 then
- gothroughsound.SoundId = "rbxassetid://2769872789"
- else
- gothroughsound.SoundId = "rbxassetid://232806289"
- end
- gothroughsound:Play()
- part.CFrame = character.Head.BluePortal.CFrame * CFrame.new(0,2,4)
- local pushv = Instance.new("BodyVelocity", part)
- pushv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- pushv.Velocity = character.Head.BluePortal.CFrame.lookVector * (-15 + partvelocity.y/1.2)
- game.Debris:AddItem(pushv, 0.2)
- end
- end
- end
- end)
- else
- awman()
- end
- end
- pellet.CFrame = pellet.CFrame * CFrame.new(0,0,-8)
- threshold = threshold + 1
- if threshold == 200 then
- pellet:destroy()
- break
- end
- end
- pellet:destroy()
- end)()
- end
- end)
- end))
- Part10.Name = "Light"
- Part10.Parent = Tool0
- Part10.CFrame = CFrame.new(6.01353025, 0.580815196, -2.69899321, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part10.Position = Vector3.new(6.01353025, 0.580815196, -2.69899321)
- Part10.Color = Color3.new(0, 1, 1)
- Part10.Transparency = 1
- Part10.Size = Vector3.new(0.230000943, 0.230000943, 0.230000943)
- Part10.BottomSurface = Enum.SurfaceType.Smooth
- Part10.BrickColor = BrickColor.new("Toothpaste")
- Part10.Material = Enum.Material.Neon
- Part10.TopSurface = Enum.SurfaceType.Smooth
- Part10.brickColor = BrickColor.new("Toothpaste")
- Part10.Shape = Enum.PartType.Ball
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = owner.Character
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Add Comment
Please, Sign In to add comment