Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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")
- LocalScript1 = Instance.new("LocalScript")
- MeshPart2 = Instance.new("MeshPart")
- LocalScript3 = Instance.new("LocalScript")
- ModuleScript4 = Instance.new("ModuleScript")
- Configuration5 = Instance.new("Configuration")
- NumberValue6 = Instance.new("NumberValue")
- NumberValue7 = Instance.new("NumberValue")
- BoolValue8 = Instance.new("BoolValue")
- NumberValue9 = Instance.new("NumberValue")
- NumberValue10 = Instance.new("NumberValue")
- Sound11 = Instance.new("Sound")
- LocalScript12 = Instance.new("LocalScript")
- Camera13 = Instance.new("Camera")
- Tool0.Name = "Portal Gun"
- Tool0.Parent = mas
- Tool0.Grip = CFrame.new(-0.63109529, 0.452967376, -0.402335078, 0.994709015, 0.000125572755, 0.102732286, 0.102732286, 1.29689943e-05, -0.994709015, -0.000126240688, 1, 0)
- Tool0.GripForward = Vector3.new(-0.102732286, 0.994709015, -0)
- Tool0.GripPos = Vector3.new(-0.63109529, 0.452967376, -0.402335078)
- Tool0.GripRight = Vector3.new(0.994709015, 0.102732286, -0.000126240688)
- Tool0.GripUp = Vector3.new(0.000125572755, 1.29689943e-05, 1)
- LocalScript1.Name = "AnimateScript(EM-500)"
- LocalScript1.Parent = Tool0
- table.insert(cors,sandbox(LocalScript1,function()
- local MOUSE_ICON = 'rbxassetid://120192974' local Tool = script.Parent
- local Mouse = nil local function UpdateIcon()
- if Mouse then Mouse.Icon = Tool.Enabled and MOUSE_ICON end end local function OnEquipped(mouse) Mouse = mouse UpdateIcon() end local function OnChanged(property)
- if property == 'Enabled' then UpdateIcon() end end Tool.Equipped:connect(OnEquipped) Tool.Changed:connect(OnChanged)
- local arms = nil
- local torso = nil
- local welds = {}
- local Tool = script.Parent
- local neck = nil
- local orginalC0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- function Equip(mouse)
- wait(0.01)
- arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
- head = Tool.Parent:FindFirstChild("Head")
- torso = Tool.Parent:FindFirstChild("Torso")
- if neck == nil then
- neck = Tool.Parent:FindFirstChild("Torso").Neck
- end
- if arms ~= nil and torso ~= nil then
- local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
- if sh ~= nil then
- local yes = true
- if yes then
- yes = false
- sh[1].Part1 = nil
- sh[2].Part1 = nil
- local weld1 = Instance.new("Weld")
- weld1.Part0 = head
- weld1.Parent = head
- weld1.Part1 = arms[1]
- welds[1] = weld1
- local weld2 = Instance.new("Weld")
- weld2.Part0 = head
- weld2.Parent = head
- weld2.Part1 = arms[2]
- welds[2] = weld2
- -------------------------here
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- mouse.Move:connect(function ()
- --local Direction = Tool.Direction.Value
- local Direction = mouse.Hit.p
- local b = head.Position.Y-Direction.Y
- local dist = (head.Position-Direction).magnitude
- local answer = math.asin(b/dist)
- neck.C0=orginalC0*CFrame.fromEulerAnglesXYZ(answer,0,0)
- wait(0.1)
- end)end
- else
- print("sh")
- end
- else
- print("arms")
- end
- end
- function Unequip(mouse)
- if arms ~= nil and torso ~= nil then
- local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
- if sh ~= nil then
- local yes = true
- if yes then
- yes = false
- neck.C0 = orginalC0
- sh[1].Part1 = arms[1]
- sh[2].Part1 = arms[2]
- welds[1].Parent = nil
- welds[2].Parent = nil
- end
- else
- print("sh")
- end
- else
- print("arms")
- end
- end
- Tool.Equipped:connect(Equip)
- Tool.Unequipped:connect(Unequip)
- function Animate()
- arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
- if Tool.AnimateValue.Value == "Shoot" then
- local weld1 = welds[1]
- local weld2 = welds[2]
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- wait(0.00001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.05, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- wait(0.00001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.1, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(-15), 0)
- wait(0.00001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.3, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0)
- wait(0.00001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.35, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-115), math.rad(-15), 0)
- wait(0.00001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.00001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- Tool.AnimateValue.Value = "None"
- end
- if Tool.AnimateValue.Value == "Reload" then
- local weld1 = welds[1]
- local weld2 = welds[2]
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-105), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-115), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.45, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.9, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.5, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 1, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.55, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 1.1, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.57, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 1.2, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.6, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 1.3, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.6, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
- wait(0.0001)
- weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
- weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- Tool.AnimateValue.Value = "None"
- end
- end
- Tool.AnimateValue.Changed:connect(Animate)
- end))
- MeshPart2.Name = "Handle"
- MeshPart2.Parent = Tool0
- MeshPart2.CFrame = CFrame.new(-4.80153465, 1.16627014, -8.13521767, 9.90927219e-07, 1.00000727, -1.79058759e-06, -1.51428281e-07, -1.98858993e-06, 1.00000024, 0.999996245, 8.86619091e-07, -2.49169943e-07)
- MeshPart2.Orientation = Vector3.new(-90, -90, 0)
- MeshPart2.Position = Vector3.new(-4.80153465, 1.16627014, -8.13521767)
- MeshPart2.Rotation = Vector3.new(-90, 0, -90)
- MeshPart2.Size = Vector3.new(2.19040489, 4.31696177, 2.25249791)
- MeshPart2.CanCollide = false
- MeshPart2.TextureID = "rbxassetid://430056584"
- LocalScript3.Parent = Tool0
- table.insert(cors,sandbox(LocalScript3,function()
- local tool = script.Parent
- local debris = game:GetService("Debris")
- local timestart = false
- local timer = 0
- local model = Instance.new("Model",game.Workspace)
- local colora = BrickColor.new(Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255))
- local colorb = BrickColor.new(Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255))
- print(colora)
- print(colorb)
- tool:WaitForChild("Settings")
- local pp = script.Parent.Settings.PortalPower
- local cw = script.Parent.Settings.CameraWait
- local cg --[[;^)]] = script.Parent.Settings.CanGrab
- local gp = script.Parent.Settings.GrabPower
- local gr = script.Parent.Settings.GrabRange
- script.Parent:WaitForChild("surface")
- funcs = require(script.Parent.surface)
- function gpos(part,pos,ignore)
- local r = Ray.new(part.Position,(pos-part.Position).unit*999)
- return workspace:FindPartOnRayWithIgnoreList(r,ignore)
- end
- tool.Equipped:connect(function (mouse)
- script.Parent.Handle.Anchored = false
- local player = game.Players.LocalPlayer
- local grabbed_object = nil
- model.Name = player.Name.."'s Portals"
- local canTeleport = true
- function getModelMass(model)
- if model == nil then return 0 end
- local mass = 0
- local function getModelMass(m)
- for i,v in pairs(m:GetChildren()) do
- if v:IsA("BasePart") then
- mass = mass + v:GetMass()
- elseif v:IsA("Model") then
- getModelMass(v)
- end
- end
- end
- getModelMass(model)
- return mass
- end
- function telePortal(hit, blue)
- if hit == grabbed_object then
- grabbed_object.Grab:Destroy()
- grabbed_object = nil
- end
- if model:findFirstChild("BluePortal") and model:findFirstChild("RedPortal") then
- if hit.Parent and hit.Parent ~= workspace and hit.Anchored == false then
- if getModelMass(hit.Parent) > 60 then return else
- if hit.Parent:findFirstChild("Torso") then
- hit = hit.Parent.Torso
- end
- end
- else
- if hit:getMass() > 60 or hit.Anchored then return end
- end
- local this
- local other
- if blue then
- this = model.BluePortal
- other = model.RedPortal
- else
- this = model.RedPortal
- other = model.BluePortal
- end
- local x = math.abs(hit.Velocity.x)
- local y = math.abs(hit.Velocity.y)
- local z = math.abs(hit.Velocity.z)
- local main = 0
- if x > y and x > z then
- main = x
- elseif y > x and y > z then
- main = y
- elseif z > x and z > y then
- main = z
- end
- main = math.ceil(main)
- local dir = other.CFrame.lookVector
- local spawn = other.CFrame.p + (dir*3)
- hit.CFrame = CFrame.new(spawn, spawn+dir*2)
- hit.Velocity = dir*main*pp.Value
- end
- end
- function makePortal(pos, hit, blue)
- local p = Instance.new("Part", model)
- if blue then p.Name = "BluePortal" else p.Name = "RedPortal" end
- if blue then p.BrickColor = colora else p.BrickColor = colorb end
- p.Material = Enum.Material.Neon
- p.FormFactor = Enum.FormFactor.Custom
- p.Size = Vector3.new(4,6,3)
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Anchored = true
- local p2 = Instance.new("Part", model)
- p2.Size = Vector3.new(0.2,0.2,0.2)
- p2.CanCollide = false
- p2.TopSurface = 0
- p2.BottomSurface = 0
- p2.BrickColor = p.BrickColor
- if blue then
- p2.Name = "BP"
- else
- p2.Name = "RP"
- end
- local sm2 = Instance.new("SpecialMesh", p2)
- sm2.Scale = Vector3.new(0.45, 0.3, 0.0018)
- sm2.MeshId = "rbxassetid://431119824"
- local sm = Instance.new("SpecialMesh",p)
- sm.MeshType = "Sphere"
- sm.Scale = Vector3.new(1,1,0.01)
- p.CanCollide = false
- local dir = funcs.getSide(hit,funcs.surface(hit,pos))
- p.CFrame = CFrame.new(pos, pos + dir)
- p2.CFrame = p.CFrame * CFrame.Angles(0,0,math.pi/2)
- funcs.weld(p2,p)
- if hit.Anchored == false then
- local pos = p.CFrame:inverse() * hit.CFrame
- funcs.weld(p,hit)
- p.Anchored = false
- p.ChildRemoved:connect(function (c)
- if c.Name == "Weld" then
- p:Destroy()
- p2:Destroy()
- end
- end)
- end
- p.Touched:connect(funcs.debounce(function (h) if canTeleport then canTeleport = false telePortal(h,blue) wait(.1) canTeleport = true end end))
- end
- function firePortal(origin,dir,blue,chit,target)
- local p = Instance.new("Part", game.Workspace)
- p.FormFactor = Enum.FormFactor.Custom
- p.Size = Vector3.new(.1,.1,.1)
- p.TopSurface = 0
- p.BottomSurface = 0
- if blue then
- p.BrickColor = colora
- else
- p.BrickColor = colorb
- end
- p.Material = Enum.Material.Neon
- local sm = Instance.new("SpecialMesh",p)
- sm.MeshType = "Sphere"
- sm.Scale = Vector3.new(10,10,10)
- p.Reflectance = 1
- local bf = Instance.new("BodyForce",p)
- bf.force = Vector3.new(0,196.2,0)*p:GetMass()
- p.Velocity = dir*200
- p.CFrame = CFrame.new(origin,origin+dir)
- p:BreakJoints()
- tool.Fire:Play()
- funcs.debounce(p.Touched:connect(function (h)
- if blue and target then
- if model:FindFirstChild("BluePortal") then model.BluePortal:Destroy() end
- if model:FindFirstChild("BP") then model.BP:Destroy() end
- makePortal(chit,target,true)
- elseif not blue and target then
- if model:FindFirstChild("RedPortal") then model.RedPortal:Destroy() end
- if model:FindFirstChild("RP") then model.RP:Destroy() end
- makePortal(chit,target,false)
- end
- p:Destroy()
- end))
- debris:AddItem(p,120)
- end
- funcs.debounce(mouse.Button2Down:connect(function ()
- timestart = false
- wait(cw.Value)
- timestart = true
- end))
- funcs.debounce(mouse.Button1Down:connect(function ()
- local dir = (mouse.Hit.p - player.Character.Head.Position).unit
- local origin = player.Character.Head.Position + dir*5
- local block, pos = gpos(tool.Handle,mouse.Hit.p,{tool.Parent,model,grabbed_object})
- firePortal(origin,dir,true,pos,block)
- end))
- funcs.debounce(mouse.Button2Up:connect(function ()
- if timestart then return end
- local dir = (mouse.Hit.p - player.Character.Head.Position).unit
- local origin = player.Character.Head.Position + dir*5
- local block, pos = gpos(tool.Handle,mouse.Hit.p,{tool.Parent,model,grabbed_object})
- firePortal(origin,dir,false,pos,block)
- end))
- funcs.debounce(mouse.KeyDown:connect(function (k)
- local mt = mouse.Target
- if mt then
- if k == "e" and cg.Value then
- if grabbed_object == nil and (mt.Position - tool.Handle.Position).magnitude < gr.Value then
- if mt:getMass() > gp.Value then return end
- mt.CFrame = tool.Handle.CFrame * CFrame.new(0,6,0)
- local w = funcs.weld(mt, tool.Handle)
- w.Name = "Grab"
- grabbed_object = mt
- elseif grabbed_object then
- grabbed_object.Grab:Destroy()
- grabbed_object.Velocity = tool.Parent.Torso.CFrame.lookVector*100
- grabbed_object = nil
- end
- end
- end
- if k == "r" then
- model:ClearAllChildren()
- end
- end))
- local event = workspace.ChildRemoved:connect(function (c)
- if c == model then
- model = Instance.new("Model", workspace)
- model.Name = player.Name.."'s Portals"
- end
- end)
- player.Character.Humanoid.Died:connect(function ()
- event:disconnect()
- model:Destroy()
- end)
- end)
- tool.Unequipped:connect(function ()
- if tool.Parent == game.Workspace then
- model:Destroy()
- model = Instance.new("Model", workspace)
- end
- end)
- end))
- ModuleScript4.Name = "surface"
- ModuleScript4.Parent = Tool0
- table.insert(cors,sandbox(ModuleScript4,function()
- local module = {}
- --vvv Made by Anaminus vvv---
- local function NumNormal(n)
- return n == 0 and 0 or n/math.abs(n)
- end
- function module.surface(part,point)
- local p = part.CFrame:toObjectSpace(CFrame.new(point)).p
- local s = part.Size
- local ax,ay,az = math.abs(p.x/s.x),math.abs(p.y/s.y),math.abs(p.z/s.z)
- return Vector3.new(NumNormal(p.x),NumNormal(p.y),NumNormal(p.z)) * Vector3.new(
- (ax>ay and ax>az) and 1 or 0,
- (ay>ax and ay>az) and 1 or 0,
- (az>ax and az>ay) and 1 or 0
- )
- end
- --^^^ Made by Anaminus ^^^---
- function module.getSide(p,s)
- local cf = p.CFrame
- if s.x > 0 then
- return (cf*CFrame.fromAxisAngle(Vector3.new(0,-1,0),math.pi/2)).lookVector
- elseif s.x < 0 then
- return (cf*CFrame.fromAxisAngle(Vector3.new(0,1,0),math.pi/2)).lookVector
- end
- if s.y < 0 then
- return (cf*CFrame.fromAxisAngle(Vector3.new(-1,0,0),math.pi/2)).lookVector
- elseif s.y > 0 then
- return (cf*CFrame.fromAxisAngle(Vector3.new(1,0,0),math.pi/2)).lookVector
- end
- if s.z < 0 then
- return cf.lookVector
- elseif s.z > 0 then
- return -cf.lookVector
- end
- end
- function module.debounce(func)
- local debounce = false
- return function(...)
- if not debounce then
- debounce = true
- func(...)
- debounce = false
- end
- end
- end
- function module.part(p)
- local parts = {}
- local function getParts(m)
- for _,v in pairs(m:GetChildren()) do
- if v:IsA("Part") and v ~= p then
- table.insert(parts,#parts+1,v)
- elseif v:IsA("Model") then
- getParts(v)
- end
- end
- end
- getParts(game.Workspace)
- local winner = {}
- for _,q in pairs(parts) do
- local mag = (q.Position-p.Position).magnitude
- if mag < winner[1] then
- winner[1] = mag
- winner[2] = q
- end
- end
- return winner[2]
- end
- function module.weld(p1,p2)
- local w = Instance.new("Weld")
- w.Part0 = p1
- w.Part1 = p2
- w.C0 = p1.CFrame:inverse() * p2.CFrame
- w.Parent = p1
- return w
- end
- return module
- end))
- Configuration5.Name = "Settings"
- Configuration5.Parent = Tool0
- NumberValue6.Name = "PortalPower"
- NumberValue6.Parent = Configuration5
- NumberValue6.Value = 1
- NumberValue7.Name = "CameraWait"
- NumberValue7.Parent = Configuration5
- NumberValue7.Value = 0.65
- BoolValue8.Name = "CanGrab"
- BoolValue8.Parent = Configuration5
- BoolValue8.Value = true
- NumberValue9.Name = "GrabPower"
- NumberValue9.Parent = Configuration5
- NumberValue9.Value = 100
- NumberValue10.Name = "GrabRange"
- NumberValue10.Parent = Configuration5
- NumberValue10.Value = 5
- Sound11.Name = "Fire"
- Sound11.Parent = Tool0
- Sound11.SoundId = "rbxassetid://142774034"
- LocalScript12.Name = "MouseIcon"
- LocalScript12.Parent = Tool0
- table.insert(cors,sandbox(LocalScript12,function()
- local MOUSE_ICON = 'rbxassetid://120192974' local Tool = script.Parent
- local Mouse = nil local function UpdateIcon()
- if Mouse then Mouse.Icon = Tool.Enabled and MOUSE_ICON end end local function OnEquipped(mouse) Mouse = mouse UpdateIcon() end local function OnChanged(property)
- if property == 'Enabled' then UpdateIcon() end end Tool.Equipped:connect(OnEquipped) Tool.Changed:connect(OnChanged)
- end))
- LocalScript12.Disabled = true
- Camera13.Name = "ThumbnailCamera"
- Camera13.Parent = Tool0
- Camera13.CFrame = CFrame.new(-122.698433, 1.56488907, 9.07953835, -0.740325332, -0.0495854728, 0.670417547, -0, 0.997275949, 0.0737605989, -0.672248781, 0.05460684, -0.738308668)
- Camera13.CoordinateFrame = CFrame.new(-122.698433, 1.56488907, 9.07953835, -0.740325332, -0.0495854728, 0.670417547, -0, 0.997275949, 0.0737605989, -0.672248781, 0.05460684, -0.738308668)
- Camera13.FieldOfView = 30
- Camera13.Focus = CFrame.new(-124.039268, 1.41736782, 10.5561562, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Camera13.focus = CFrame.new(-124.039268, 1.41736782, 10.5561562, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement