Run it
Copy the script and paste it into your executor.
Players = :()
RunService = :()
UIS = :()
TweenService = :()
Debris = :()
Lighting = :()
Workspace = :()
player = Players.LocalPlayer
mouse = player:()
env = ( ())
env.__PortalGunCleanup
(env.__PortalGunCleanup)
SNAP_DIST =
TOUCH_LIFT =
BENCH_DISTANCE =
COLLECT_RADIUS =
RESPAWN_TIME =
PORTAL_W, PORTAL_H = ,
GREEN = .(, , )
BLUE = .(, , )
WHITE = .(, , )
GREY = .(, , )
SILVER = .(, , )
DARK = .(, , )
CYAN = .(, , )
PALE_GREEN = .(, , )
ROT = .(, .pi / , )
UPRIGHT = .(, , .pi / )
Block, Cyl, Ball = .PartType.Block, .PartType.Cylinder, .PartType.Ball
Plastic, Metal, Neon, Glass = .Material.SmoothPlastic, .Material.Metal, .Material.Neon, .Material.Glass
(x, y, z) .(x, y, z)
MATERIALS = {
scrap = { name = , color = .(, , ) },
circuit = { name = , color = .(, , ) },
fluid = { name = , color = .(, , ) },
goo = { name = , color = .(, , ) },
crystal = { name = , color = .(, , ) },
plasma = { name = , color = .(, , ) },
}
MAT_ORDER = { , , , , , }
inv = {}
_, id (MAT_ORDER) inv[id] =
NODE_SHAPES = {
scrap = (add)
(Cyl, (, , ), .(), .(, , ), Metal)
(Cyl, (, , ), .(), DARK, Metal)
_, o ({ (, , ), (, -, ), (, , ), (, , -) })
(Block, (, , ), .(o), .(, , ), Metal)
,
circuit = (add)
(Block, (, , ), .(), .(, , ), Plastic)
(Block, (, , ), .(, , ), DARK, Plastic)
(Block, (, , ), .(, , ), .(, , ), Neon)
(Block, (, , ), .(-, , -), .(, , ), Neon)
,
fluid = (add)
(Cyl, (, , ), UPRIGHT, .(, , ), Glass, )
(Cyl, (, , ), .(, -, ) * UPRIGHT, GREEN, Neon)
(Cyl, (, , ), .(, , ) * UPRIGHT, DARK, Plastic)
,
goo = (add)
(Ball, (, , ), .(), .(, , ), Neon)
(Ball, (, , ), .(, -, ), .(, , ), Neon)
(Ball, (, , ), .(-, , ), .(, , ), Neon)
,
crystal = (add)
c = .(, , )
(Block, (, , ), .(, .(), ), c, Neon)
(Block, (, , ), .(, -, ) * .(, , ), .(, , ), Neon)
(Block, (, , ), .(-, -, ) * .(, , -), .(, , ), Neon)
,
plasma = (add)
(Ball, (, , ), .(), .(, , ), Glass, )
(Ball, (, , ), .(), .(, , ), Neon)
,
}
GUN = {
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ) * UPRIGHT, color = DARK, material = Plastic },
{ name = , label = , shape = Ball, size = (, , ), offset = .(, -, ), color = .(, , ), material = Metal },
{ name = , label = , shape = Block, size = (, , ), offset = .(, , -), color = WHITE, material = Plastic },
{ name = , label = , shape = Block, size = (, , ), offset = .(, , ), color = GREY, material = Metal },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ) * ROT, color = DARK, material = Plastic },
{ name = , label = , shape = Block, size = (, , ), offset = .(, , ), color = CYAN, material = Neon },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , -) * ROT, color = SILVER, material = Metal },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , -) * ROT, color = DARK, material = Plastic },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , -) * ROT, color = DARK, material = Plastic },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , -) * ROT, color = DARK, material = Plastic },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , -) * ROT, color = GREEN, material = Neon },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , -) * UPRIGHT, color = GREY, material = Metal },
{ name = , label = , shape = Ball, size = (, , ), offset = .(, , -), color = GREEN, material = Glass, transparency = },
{ name = , label = , shape = Ball, size = (, , ), offset = .(, , -), color = PALE_GREEN, material = Neon },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ), color = GREEN, material = Neon },
}
LANTERN = {
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ) * UPRIGHT, color = DARK, material = Plastic },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ) * UPRIGHT, color = GREY, material = Metal },
{ name = , label = , shape = Ball, size = (, , ), offset = .(, , ), color = .(, , ), material = Neon },
{ name = , label = , shape = Ball, size = (, , ), offset = .(, , ), color = .(, , ), material = Glass, transparency = },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ) * UPRIGHT, color = GREY, material = Metal },
{ name = , label = , shape = Cyl, size = (, , ), offset = .(, , ), color = DARK, material = Plastic },
}
SLOTS = {
{ -, }, { -, }, { -, }, { -, }, { , },
{ , }, { , }, { , }, { , }, { -, },
{ -, }, { , }, { , - }, { -, - }, { -, - },
{ -, - }, { -, - }, { , - }, { , - },
}
(cf, s)
.(cf.Position * s) * (cf - cf.Position)
(cf, size)
* (.(cf.RightVector.Y) * size.X + .(cf.UpVector.Y) * size.Y + .(cf.LookVector.Y) * size.Z)
(c)
():(.(c.R * + ), .(c.G * + ), .(c.B * + ))
(parent, shape, size, cf, color, material, transparency, collide, query)
p = .()
p.Shape = shape
p.Size = size
p.CFrame = cf
p.Color = color
p.Material = material
p.Transparency = transparency
p.TopSurface = .SurfaceType.Smooth
p.BottomSurface = .SurfaceType.Smooth
p.Anchored =
p.CanCollide = collide
p.CanQuery = query
p.CanTouch =
p.Parent = parent
p
(def, scale)
p = .()
p.Name = def.name
p.Shape = def.shape
p.Size = def.size * scale
p.Color = def.color
p.Material = def.material
p.Transparency = def.transparency
p.TopSurface = .SurfaceType.Smooth
p.BottomSurface = .SurfaceType.Smooth
p.Anchored =
p.CanCollide =
p.CanQuery =
p.CanTouch =
p
connections, objects = {}, {}
(c) .(connections, c) c
(o) .(objects, o) o
inBench, ready, dragging, dragIsTouch, traveling = , , , ,
step =
active =
owned = {}
benchBuilt =
benchModel, benchPivotLocal, buildFolder
B = .()
camLocal = .()
targetsLocal, restYs, looseParts, ghosts = {}, {}, {}, {}
highlight, renderConn, camTween
pointerPos = .zero
saved = {}
portals = {}
currentDim, homeCF = ,
giveTools, exitBench, refreshBag, refreshRecipeMenu, updateSideButtons
portalFolder = (.())
portalFolder.Name =
portalFolder.Parent = Workspace
dimFolder = (.())
dimFolder.Name =
dimFolder.Parent = Workspace
gui = (.())
gui.Name =
gui.ResetOnSpawn =
gui.IgnoreGuiInset =
gui.DisplayOrder =
gui.Parent = player:()
(inst, r)
c = .()
c.CornerRadius = .(, r )
c.Parent = inst
(inst, n)
p = .()
p.PaddingTop, p.PaddingBottom, p.PaddingLeft, p.PaddingRight = .(, n), .(, n), .(, n), .(, n)
p.Parent = inst
(inst, gap, align)
l = .()
l.Padding = .(, gap)
l.SortOrder = .SortOrder.LayoutOrder
align l.HorizontalAlignment = align
l.Parent = inst
l
catcher = .()
catcher.Name =
catcher.Size = .(, , , )
catcher.BackgroundTransparency =
catcher.BorderSizePixel =
catcher.Active =
catcher.Visible =
catcher.ZIndex =
catcher.Parent = gui
(className)
l = .(className)
l.BackgroundColor3 = .(, , )
l.BackgroundTransparency =
l.TextColor3 = .(, , )
l.Font = .Font.GothamMedium
l.TextSize =
l.TextWrapped =
l.Visible =
l.BorderSizePixel =
l.ZIndex =
l.Parent = gui
(l)
l
panel = ()
panel.AnchorPoint = .(, )
panel.Position = .(, , , )
panel.Size = .(, , , )
exitBtn = ()
exitBtn.AnchorPoint = .(, )
exitBtn.Position = .(, -, , -)
exitBtn.Size = .(, , , )
exitBtn.Text =
exitBtn.BackgroundColor3 = .(, , )
cancelBtn = ()
cancelBtn.AnchorPoint = .(, )
cancelBtn.Position = .(, , , -)
cancelBtn.Size = .(, , , )
cancelBtn.Text =
cancelBtn.TextSize =
cancelBtn.BackgroundColor3 = .(, , )
toastLabel = ()
toastLabel.AnchorPoint = .(, )
toastLabel.Position = .(, , , -)
toastLabel.Size = .(, , , )
toastLabel.ZIndex =
toastId =
(text)
toastId +=
id = toastId
toastLabel.Text = text
toastLabel.Visible =
.(, ()
toastId == id toastLabel.Visible =
)
fade = .()
fade.Size = .(, , , )
fade.BackgroundColor3 = .(, , )
fade.BackgroundTransparency =
fade.BorderSizePixel =
fade.Active =
fade.ZIndex =
fade.Parent = gui
(t, dur)
tw = TweenService:(fade, TweenInfo.(dur), { BackgroundTransparency = t })
tw:()
tw.Completed:()
side = .()
side.Name =
side.AnchorPoint = .(, )
side.Position = .(, -, , )
side.Size = .(, , , )
side.AutomaticSize = .AutomaticSize.Y
side.BackgroundTransparency =
side.ZIndex =
side.Parent = gui
(side, , .HorizontalAlignment.Right)
sideTitle = .()
sideTitle.Size = .(, , , )
sideTitle.BackgroundTransparency =
sideTitle.Text =
sideTitle.TextColor3 = .(, , )
sideTitle.Font = .Font.GothamBold
sideTitle.TextSize =
sideTitle.LayoutOrder =
sideTitle.ZIndex =
sideTitle.Parent = side
sideButtons = {}
(text, color, order)
b = .()
b.Size = .(, , , )
b.BackgroundColor3 = .(, , )
b.BackgroundTransparency =
b.TextColor3 = .(, , )
b.Font = .Font.GothamBold
b.TextSize =
b.Text = text
b.LayoutOrder = order
b.ZIndex =
b.BorderSizePixel =
b.Parent = side
(b, )
s = .()
s.Color = color
s.Thickness =
s.Parent = b
b, s
bagPanel = .()
bagPanel.AnchorPoint = .(, )
bagPanel.Position = .(, -, , )
bagPanel.Size = .(, , , )
bagPanel.AutomaticSize = .AutomaticSize.Y
bagPanel.BackgroundColor3 = .(, , )
bagPanel.BackgroundTransparency =
bagPanel.BorderSizePixel =
bagPanel.Visible =
bagPanel.ZIndex =
bagPanel.Parent = gui
(bagPanel)
(bagPanel, )
(bagPanel, )
bagTitle = .()
bagTitle.Size = .(, , , )
bagTitle.BackgroundTransparency =
bagTitle.Text =
bagTitle.TextColor3 = .(, , )
bagTitle.Font = .Font.GothamBold
bagTitle.TextSize =
bagTitle.LayoutOrder =
bagTitle.ZIndex =
bagTitle.Parent = bagPanel
bagRows = {}
i, id (MAT_ORDER)
row = .()
row.Size = .(, , , )
row.BackgroundTransparency =
row.LayoutOrder = i
row.ZIndex =
row.Parent = bagPanel
swatch = .()
swatch.Size = .(, , , )
swatch.Position = .(, , , )
swatch.BackgroundColor3 = MATERIALS[id].color
swatch.BorderSizePixel =
swatch.ZIndex =
swatch.Parent = row
(swatch, )
nameLbl = .()
nameLbl.Size = .(, -, , )
nameLbl.Position = .(, , , )
nameLbl.BackgroundTransparency =
nameLbl.Text = MATERIALS[id].name
nameLbl.TextColor3 = .(, , )
nameLbl.Font = .Font.GothamMedium
nameLbl.TextSize =
nameLbl.TextXAlignment = .TextXAlignment.Left
nameLbl.ZIndex =
nameLbl.Parent = row
countLbl = .()
countLbl.Size = .(, , , )
countLbl.Position = .(, -, , )
countLbl.BackgroundTransparency =
countLbl.Text =
countLbl.TextColor3 = .(, , )
countLbl.Font = .Font.GothamBold
countLbl.TextSize =
countLbl.TextXAlignment = .TextXAlignment.Right
countLbl.ZIndex =
countLbl.Parent = row
bagRows[id] = countLbl
()
id, lbl (bagRows)
lbl.Text = (inv[id])
refreshRecipeMenu ()
menu = .()
menu.AnchorPoint = .(, )
menu.Position = .(, , , )
menu.Size = .(, , , )
menu.AutomaticSize = .AutomaticSize.Y
menu.BackgroundColor3 = .(, , )
menu.BackgroundTransparency =
menu.BorderSizePixel =
menu.Visible =
menu.ZIndex =
menu.Parent = gui
(menu)
(menu, )
(menu, )
menuTitle = .()
menuTitle.Size = .(, , , )
menuTitle.BackgroundTransparency =
menuTitle.Text =
menuTitle.TextColor3 = .(, , )
menuTitle.Font = .Font.GothamBold
menuTitle.TextSize =
menuTitle.LayoutOrder =
menuTitle.ZIndex =
menuTitle.Parent = menu
()
ch = player.Character
ch ch:(), ch ch:()
controls
(enabled)
controls
(()
controls = (player:():(, )):()
)
controls
(()
enabled controls:() controls:()
)
(cost)
id, need (cost)
(inv[id] ) < need
(cost)
id, need (cost) inv[id] -= need
()
(cost)
id, need (cost) inv[id] += need
()
(d)
currentDim == d
currentDim = d
env.__PortalGunApplyLook env.(d)
()
(idx, pos, normal)
_, root = ()
n = normal
center
.(normal.Y) >
flat = root .(root.Position.X - pos.X, , root.Position.Z - pos.Z) .zero
n = flat.Magnitude > flat.Unit .(, , )
lift = normal.Y > PORTAL_H / -PORTAL_H /
center = pos + .(, lift, ) + n *
center = pos + normal *
cf = .(center, center + n) * .(, .pi / , )
portals[idx]
portals[idx].model:()
portals[idx] =
model = .()
model.Name = .. idx
model.Parent = portalFolder
(size, color, transparency)
d = (model, Cyl, .(size.X, , ), cf, color, Neon, transparency, , )
d.CastShadow =
TweenService:(d, TweenInfo.(, .EasingStyle.Back, .EasingDirection.Out), { Size = size }):()
d
outer = ((, PORTAL_H, PORTAL_W), GREEN, )
((, PORTAL_H * , PORTAL_W * ), .(, , ), )
swirl = ((, PORTAL_H * , PORTAL_W * ), .(, , ), )
pe = .()
pe.Texture =
pe.Color = ColorSequence.(GREEN)
pe.LightEmission =
pe.Rate =
pe.Lifetime = NumberRange.(, )
pe.Speed = NumberRange.(, )
pe.SpreadAngle = .(, )
pe.Size = NumberSequence.({ NumberSequenceKeypoint.(, ), NumberSequenceKeypoint.(, ) })
pe.Parent = outer
light = .()
light.Color = GREEN
light.Range =
light.Brightness =
light.Parent = outer
portals[idx] = { model = model, cf = cf, swirl = swirl, dim = currentDim }
spin, tpCooldown = ,
(RunService.Heartbeat:((dt)
spin += dt *
i = ,
p = portals[i]
p p.swirl.Parent
p.swirl.CFrame = p.cf * .(spin * (i == -), , )
.() < tpCooldown
_, root = ()
root
i = ,
a, b = portals[i], portals[ - i]
a b a.dim == currentDim
rel = a.cf:(root.Position)
.(rel.X) < .(rel.Y) < PORTAL_H / - .(rel.Z) < PORTAL_W / -
n = b.cf.RightVector
flat = .(n.X, , n.Z)
flat = flat.Magnitude > flat.Unit .(, , -)
exitPos = b.cf.Position + flat * + .(, -, )
params = RaycastParams.()
params.FilterType = .RaycastFilterType.Exclude
params.FilterDescendantsInstances = { player.Character, portalFolder }
down = Workspace:(exitPos, .(, -, ), params)
down
exitPos = .(exitPos.X, down.Position.Y + , exitPos.Z)
b.dim ~= currentDim
currentDim homeCF = root.CFrame
(b.dim)
root.CFrame = .(exitPos, exitPos + flat)
root.AssemblyLinearVelocity = .zero
tpCooldown = .() +
))
(from, to)
len = (to - from).Magnitude
len <
b = (portalFolder, Block, (, , len), .(from, to) * .(, , -len / ), GREEN, Neon, , , )
TweenService:(b, TweenInfo.(), { Transparency = , Size = (, , len) }):()
Debris:(b, )
nextPortal, lastShot = ,
(tool)
.() - lastShot <
lastShot = .()
char = player.Character
char
unit = mouse.UnitRay
params = RaycastParams.()
params.FilterType = .RaycastFilterType.Exclude
params.FilterDescendantsInstances = { char, portalFolder }
result = Workspace:(unit.Origin, unit.Direction * , params)
lens = tool:()
from = lens lens.Position (char.PrimaryPart char.PrimaryPart.Position) unit.Origin
result
(from, unit.Origin + unit.Direction * )
()
(from, result.Position)
(nextPortal, result.Position, result.Normal)
( .. nextPortal .. )
nextPortal = nextPortal % +
(toolName, parts, setup)
tool = (.())
tool.Name = toolName
tool.ToolTip = toolName
tool.CanBeDropped =
tool.RequiresHandle =
handle = .()
handle.Name =
handle.Size = (, , )
handle.Transparency =
handle.CanCollide =
handle.Massless =
handle.Parent = tool
_, def (parts)
p = (def, )
p.Anchored =
p.Massless =
w = .()
w.Part0 = handle
w.Part1 = p
w.C0 = def.offset
w.Parent = p
p.Parent = tool
setup (tool)
tool
()
(, GUN, (tool)
glow = .()
glow.Color = GREEN
glow.Range =
glow.Brightness =
glow.Parent = tool:()
tool.Activated:(() (tool) )
)
()
(, LANTERN, (tool)
glow = .()
glow.Color = .(, , )
glow.Range =
glow.Brightness =
glow.Parent = tool:()
)
RECIPES = {
{
id = , name = , toolName = ,
cost = { scrap = , circuit = , fluid = , crystal = , plasma = },
scale = , parts = GUN,
asm = .(-, , -) * .(, -.pi / , ),
createTool = createPortalGunTool,
},
{
id = , name = , toolName = ,
cost = { scrap = , goo = , plasma = , crystal = },
scale = , parts = LANTERN,
asm = .(, , -),
createTool = createLanternTool,
},
}
(rng, base, taken)
(r)
_ = ,
a = rng:() * .pi *
dist = + rng:() *
x, z = base.X + .(a) * dist, base.Z + .(a) * dist
ok =
_, t (taken)
(t.x - x) ^ + (t.z - z) ^ < (t.r + r + ) ^ ok =
ok
.(taken, { x = x, z = z, r = r })
.(x, base.Y, z)
(ctx)
f, rng = ctx.folder, ctx.rng
()
.(rng:(, ), rng:(, ), rng:(, ))
_ = ,
p = ctx.()
p
k = , rng:(, )
sz = (rng:(, ), rng:(, ), rng:(, ))
cf = .(p + (rng:(-, ), (k - ) * + sz.Y / , rng:(-, ))) * .(, rng:(, ), )
(f, Block, sz, cf, (), .Material.CorrodedMetal, , , )
_ = ,
p = ctx.()
p (f, Cyl, (, , ), .(p + (, , )) * UPRIGHT, DARK, Plastic, , , )
_ = ,
p = ctx.()
p
h = rng:(, )
(f, Block, (, h, ), .(p + (, h / , )), .(, , ), .Material.CorrodedMetal, , , )
(ctx)
f, rng = ctx.folder, ctx.rng
_ = ,
p = ctx.()
p
h = rng:(, )
(f, Cyl, (h, , ), .(p + (, h / , )) * UPRIGHT, .(, , ), .Material.Wood, , , )
s = rng:(, )
(f, Ball, (s, s, s), .(p + (, h + , )), .(, , ), Plastic, , , )
_ = ,
p = ctx.()
p
(f, Cyl, (, , ), .(p + (, , )) * UPRIGHT, .(, , ), Plastic, , , )
(f, Cyl, (, , ), .(p + (, , )) * UPRIGHT, .(, , ), Plastic, , , )
(f, Ball, (, , ), .(p + (, , )), CYAN, Neon, , , )
(f, Ball, (, , ), .(p + (-, , -)), CYAN, Neon, , , )
_ = ,
p = ctx.()
p (f, Cyl, (, , ), .(p + (, , )) * UPRIGHT, .(, , ), Neon, , , )
(ctx)
f, rng = ctx.folder, ctx.rng
i = ,
p = ctx.()
p
h = rng:(, )
cf = .(p + (, h / - , )) * .(rng:(-, ), rng:(, ), rng:(-, ))
c = i % == .(, , ) .(, , )
(f, Block, (, h, ), cf, c, Neon, , , )
_ = ,
p = ctx.()
p
s = rng:(, )
(f, Ball, (s, s, s), .(p + (, rng:(, ), )), .(, , ), .Material.Slate, , , )
(ctx)
f, rng = ctx.folder, ctx.rng
_ = ,
p = ctx.()
p (f, Cyl, (, , ), .(p + (, , )) * UPRIGHT, .(, , ), Neon, , , )
_ = ,
p = ctx.()
p
h = rng:(, )
(f, Block, (, h, ), .(p + (, h / , )), .(, , ), .Material.Basalt, , , )
(f, Block, (, h * , ), .(p + (, h * , )), .(, , ), Neon, , , )
_ = ,
a = rng:() * .pi *
d = + rng:() *
(f, Ball, (, , ), .(ctx.base + (.(a) * d, rng:(, ), .(a) * d)), .(, , ), Neon, , , )
DIMENSIONS = {
{
id = , name = , tag = , seed = ,
color = .(, , ), ground = .(, , ), groundMat = .Material.Slate,
nodes = { { , }, { , } }, decor = decorJunk,
look = { clock = , ambient = .(, , ), outdoor = .(, , ), brightness = ,
density = , color = .(, , ), decay = .(, , ), haze = , glare = ,
tint = .(, , ), sat = -, contrast = },
},
{
id = , name = , tag = , seed = ,
color = .(, , ), ground = .(, , ), groundMat = .Material.Mud,
nodes = { { , }, { , } }, decor = decorSwamp,
look = { clock = , ambient = .(, , ), outdoor = .(, , ), brightness = ,
density = , color = .(, , ), decay = .(, , ), haze = , glare = ,
tint = .(, , ), sat = , contrast = },
},
{
id = , name = , tag = , seed = ,
color = .(, , ), ground = .(, , ), groundMat = .Material.Slate,
nodes = { { , }, { , } }, decor = decorVoid,
look = { clock = , ambient = .(, , ), outdoor = .(, , ), brightness = ,
density = , color = .(, , ), decay = .(, , ), haze = , glare = ,
tint = .(, , ), sat = , contrast = },
},
{
id = , name = , tag = , seed = ,
color = .(, , ), ground = .(, , ), groundMat = .Material.Basalt,
nodes = { { , }, { , } }, decor = decorForge,
look = { clock = , ambient = .(, , ), outdoor = .(, , ), brightness = ,
density = , color = .(, , ), decay = .(, , ), haze = , glare = ,
tint = .(, , ), sat = , contrast = },
},
}
i, d (DIMENSIONS) d.index = i
lightBackup, atmo, atmoCreated, atmoBackup, cc
(d)
d
lightBackup
k, v (lightBackup) (() Lighting[k] = v )
lightBackup =
atmo
atmoCreated
atmo:()
atmoBackup
k, v (atmoBackup) (() atmo[k] = v )
atmo =
cc cc:() cc =
lightBackup
lightBackup = { ClockTime = Lighting.ClockTime, Ambient = Lighting.Ambient, OutdoorAmbient = Lighting.OutdoorAmbient, Brightness = Lighting.Brightness }
L = d.look
Lighting.ClockTime = L.clock
Lighting.Ambient = L.ambient
Lighting.OutdoorAmbient = L.outdoor
Lighting.Brightness = L.brightness
atmo
atmo = Lighting:()
atmo
atmoCreated =
atmoBackup = { Density = atmo.Density, Offset = atmo.Offset, Color = atmo.Color, Decay = atmo.Decay, Glare = atmo.Glare, Haze = atmo.Haze }
atmoCreated =
atmo = .()
atmo.Parent = Lighting
atmo.Density = L.density
atmo.Color = L.color
atmo.Decay = L.decay
atmo.Haze = L.haze
atmo.Glare = L.glare
cc
cc = .()
cc.Parent = Lighting
cc.TintColor = L.tint
cc.Saturation = L.sat
cc.Contrast = L.contrast
env.__PortalGunApplyLook = applyLook
(parent, matId, pos)
model = .()
model.Name = .. matId
pivot = (model, Block, (, , ), .(), .(), Plastic, , , )
model.PrimaryPart = pivot
NODE_SHAPES[matId]((shape, size, offset, color, material, transparency)
(model, shape, size, offset, color, material, transparency, , )
)
model.Parent = parent
model:(.(pos))
model
(d)
d.built
d.built =
rng = Random.(d.seed)
base = .(d.index * , , )
d.base = base
folder = .()
folder.Name = .. d.id
folder.Parent = dimFolder
ground = (folder, Cyl, (, , ), .(base - (, , )) * UPRIGHT, d.ground, d.groundMat, , , )
ground.Name =
(folder, Cyl, (, , ), .(base + (, , )) * UPRIGHT, d.color, Neon, , , )
i = ,
a = (i / ) * .pi *
pos = base + (.(a) * , , .(a) * )
(folder, Block, (, , ), .(pos, (base.X, pos.Y, base.Z)), .(), Plastic, , , )
taken = { { x = base.X, z = base.Z, r = } }
d.nodes_built = {}
nodeFolder = .()
nodeFolder.Name =
nodeFolder.Parent = folder
_, entry (d.nodes)
matId, count = entry[], entry[]
_ = , count
_ = ,
a = rng:() * .pi *
dist = + rng:() *
x, z = base.X + .(a) * dist, base.Z + .(a) * dist
ok =
_, t (taken)
(t.x - x) ^ + (t.z - z) ^ < (t.r + ) ^ ok =
ok
.(taken, { x = x, z = z, r = })
pos = .(x, base.Y + , z)
.(d.nodes_built, {
mat = matId, pos = pos, phase = rng:() * , active = ,
folder = nodeFolder, model = (nodeFolder, matId, pos),
})
d.({ folder = folder, rng = rng, base = base, spot = (rng, base, taken) })
(pos, color)
p = (portalFolder, Ball, (, , ), .(pos), color, Neon, , , )
TweenService:(p, TweenInfo.(), { Size = (, , ), Transparency = }):()
Debris:(p, )
(n)
n.active =
inv[n.mat] +=
()
( .. MATERIALS[n.mat].name)
(n.pos, MATERIALS[n.mat].color)
n.model.Parent =
.(RESPAWN_TIME + n.phase * , ()
(()
n.model.Parent = n.folder
n.active =
)
)
(RunService.Heartbeat:(()
d = currentDim
d d.nodes_built
_, root = ()
t = .()
_, n (d.nodes_built)
n.active
n.model:(.(n.pos + (, .(t * + n.phase) * , )) * .(, t * + n.phase, ))
root (root.Position - n.pos).Magnitude < COLLECT_RADIUS
(n)
root root.Position.Y < d.base.Y -
root.CFrame = .(d.base + (, , ))
root.AssemblyLinearVelocity = .zero
))
()
id, entry (sideButtons)
isHere = (id == currentDim == ) (currentDim ~= currentDim.id == id)
entry.stroke.Thickness = isHere
entry.button.BackgroundColor3 = isHere .(, , ) .(, , )
(d)
traveling
d == currentDim
(d ( .. d.name) )
_, root = ()
root
inBench
hum = ()
hum hum:()
()
traveling =
(, )
_, root2 = ()
root2
d
(d)
currentDim homeCF = root2.CFrame
root2.CFrame = .(d.base + (, , ))
homeCF
root2.CFrame = homeCF
root2.AssemblyLinearVelocity = .zero
(d)
(, )
traveling =
(d ( .. d.tag .. .. d.name) )
bagBtn = (, .(, , ), )
(bagBtn.Activated:(()
bagPanel.Visible = bagPanel.Visible
))
homeBtn, homeStroke = (, .(, , ), )
sideButtons.home = { button = homeBtn, stroke = homeStroke }
(homeBtn.Activated:(() () ))
i, d (DIMENSIONS)
b, s = (d.name, d.color, + i)
sideButtons[d.id] = { button = b, stroke = s }
(b.Activated:(() (d) ))
()
()
benchBuilt
benchBuilt =
benchModel = (.())
benchModel.Name =
(name, size, pos, color, material, transparency, shape)
p = (benchModel, shape Block, size, .(pos), color, material, transparency, , )
p.Name = name
p
wood = .(, , )
darkWood = .(, , )
top = (, (, , ), (, -, ), wood, .Material.WoodPlanks)
(, (, , ), (, -, ), darkWood, .Material.Wood)
_, sx ({ -, })
_, sz ({ -, })
(, (, , ), (sx * , -, sz * ), darkWood, .Material.Wood)
(, (, , ), (, , -), .(, , ), .Material.WoodPlanks)
(, (, , ), (-, , -), .(, , ), Metal)
(, (, , ), (-, , -), .(, , ), Metal)
mug = (, (, , ), (, , -), .(, , ), Plastic, , Cyl)
mug.CFrame = .(, , -) * UPRIGHT
(, (, , ), (, , -), .(, , ), Metal)
(, (, , ), (, , -), .(, , ), Metal)
(, (, , ), (, , -), darkWood, .Material.Wood)
lamp = (, (, , ), (, , ), WHITE, Plastic, )
l = .()
l.Brightness =
l.Range =
l.Color = .(, , )
l.Parent = lamp
benchModel.PrimaryPart = top
benchPivotLocal = top.CFrame
camLocal = .((, , ), (, , ))
()
_, root = ()
pos = root root.Position (, , )
look = root root.CFrame.LookVector (, , -)
f = .(look.X, , look.Z)
f = f.Magnitude > f.Unit (, , -)
p = pos + f * BENCH_DISTANCE
params = RaycastParams.()
params.FilterType = .RaycastFilterType.Exclude
params.FilterDescendantsInstances = { player.Character, portalFolder, benchModel }
hit = Workspace:(.(p.X, pos.Y + , p.Z), (, -, ), params)
groundY = hit hit.Position.Y (pos.Y - )
origin = .(p.X, groundY + , p.Z)
.(origin, origin + f)
(i)
B * targetsLocal[i]
()
highlight
highlight:()
highlight =
i, g (ghosts)
g:()
ghosts[i] =
()
()
buildFolder buildFolder:() buildFolder =
targetsLocal, restYs, looseParts, ghosts = {}, {}, {}, {}
active =
step =
dragging =
()
panel.Text =
cancelBtn.Visible =
()
menu.Visible =
()
()
active
recipe = active.recipe
step > #recipe.parts
def = recipe.parts[step]
g = (def, recipe.scale)
g.Name =
g.Color = BLUE
g.Material = Neon
g.Transparency =
g.CFrame = (step)
g.Parent = buildFolder
ghosts[step] = g
(()
hl = .()
hl.Adornee = looseParts[step]
hl.FillColor = .(, , )
hl.FillTransparency =
hl.OutlineColor = .(, , )
hl.DepthMode = .HighlightDepthMode.AlwaysOnTop
hl.Parent = looseParts[step]
highlight = hl
)
panel.Text = ():(recipe.name, step, #recipe.parts, def.label)
(recipe)
()
buildFolder = .()
buildFolder.Name =
buildFolder.Parent = benchModel
active = { recipe = recipe }
step =
i, def (recipe.parts)
target = recipe.asm * (def.offset, recipe.scale)
targetsLocal[i] = target
p = (def, recipe.scale)
restYs[i] = (target, p.Size) +
slot = SLOTS[i]
p.CFrame = B * (.(slot[], restYs[i], slot[]) * (target - target.Position))
p.Parent = buildFolder
looseParts[i] = p
menu.Visible =
cancelBtn.Visible =
()
(recipe)
owned[recipe.id] =
panel.Text = recipe.name ..
.(, ()
()
(recipe.name .. )
()
hum = ()
hum hum:()
()
)
()
i = step
part = looseParts[i]
recipe = active.recipe
dragging =
TweenService:(part, TweenInfo.(, .EasingStyle.Quad, .EasingDirection.Out), { = (i) }):()
hl = highlight
highlight =
hl
hl.FillColor = BLUE
hl.FillTransparency =
TweenService:(hl, TweenInfo.(), { FillTransparency = , OutlineTransparency = }):()
Debris:(hl, )
ghosts[i]
ghosts[i]:()
ghosts[i] =
step = i +
step > #recipe.parts
(recipe)
()
()
dragging
dragging =
part = looseParts[step]
part targetsLocal[step]
(part.Position - (step).Position).Magnitude < SNAP_DIST
()
rest = .(part.Position.X, B.Y + restYs[step], part.Position.Z)
TweenService:(part, TweenInfo.(, .EasingStyle.Quad, .EasingDirection.In), { Position = rest }):()
(screenPos, worldY)
ray = Workspace.CurrentCamera:(screenPos.X, screenPos.Y)
d = ray.Direction
.(d.Y) <
t = (worldY - ray.Origin.Y) / d.Y
t <
ray.Origin + d * t
()
ready
part, ghost, tLocal = looseParts[step], ghosts[step], targetsLocal[step]
(part tLocal)
tWorld = B * tLocal
dragging
p = dragIsTouch (pointerPos + .(, -TOUCH_LIFT)) pointerPos
hit = (p, tWorld.Position.Y)
hit
lp = B:(hit)
goal = B:(.(.(lp.X, -, ), tLocal.Position.Y, .(lp.Z, -, )))
part.Position = part.Position:(goal, )
ghost
near = dragging (part.Position - ghost.Position).Magnitude < SNAP_DIST
ghost.Transparency = near ( + * .(.() * ))
(recipe)
owned[recipe.id]
( .. recipe.name)
(recipe.cost)
()
(recipe.cost)
(recipe)
()
_, c (menu:())
c:() c:()
i, r (RECIPES)
btn = .()
btn:(, )
btn.Size = .(, , , )
btn.AutomaticSize = .AutomaticSize.Y
btn.BackgroundColor3 = .(, , )
btn.BorderSizePixel =
btn.RichText =
btn.TextWrapped =
btn.TextXAlignment = .TextXAlignment.Left
btn.TextYAlignment = .TextYAlignment.Top
btn.TextColor3 = .(, , )
btn.Font = .Font.GothamMedium
btn.TextSize =
btn.LayoutOrder = i
btn.ZIndex =
lines = { .. r.name .. }
owned[r.id]
.(lines, )
_, id (MAT_ORDER)
need = r.cost[id]
need
have = inv[id]
.(lines, ():(have >= need , MATERIALS[id].name, have, need))
(r.cost)
.(lines, )
btn.Text = .(lines, )
btn.Parent = menu
(btn, )
(btn, )
btn.Activated:(() (r) )
()
inBench
()
inBench =
ready =
dragging =
B = ()
benchModel.Parent = Workspace
benchModel:(B * benchPivotLocal)
cam = Workspace.CurrentCamera
hum = ()
saved.fov = cam.FieldOfView
hum
saved.walk, saved.jp, saved.jh = hum.WalkSpeed, hum.JumpPower, hum.JumpHeight
hum.WalkSpeed =
hum.JumpPower =
hum.JumpHeight =
()
cam.CameraType = .CameraType.Scriptable
side.Visible =
bagPanel.Visible =
panel.Visible =
exitBtn.Visible =
catcher.Visible =
active
cancelBtn.Visible =
()
()
camTween = TweenService:(cam, TweenInfo.(, .EasingStyle.Quart, .EasingDirection.InOut), {
= B * camLocal,
FieldOfView = ,
})
camTween:()
.(, ()
inBench ready =
)
renderConn = RunService.RenderStepped:(onRender)
()
inBench
inBench, ready = ,
dragging
dragging =
part = looseParts[step]
part restYs[step]
part.Position = .(part.Position.X, B.Y + restYs[step], part.Position.Z)
camTween camTween:()
renderConn
renderConn:()
renderConn =
panel.Visible =
exitBtn.Visible =
cancelBtn.Visible =
menu.Visible =
catcher.Visible =
side.Visible =
cam = Workspace.CurrentCamera
hum = ()
hum
hum.WalkSpeed = saved.walk
hum.JumpPower = saved.jp
hum.JumpHeight = saved.jh
cam.CameraSubject = hum
()
cam.FieldOfView = saved.fov
cam.CameraType = .CameraType.Custom
benchModel benchModel.Parent =
()
tool = (.())
tool.Name =
tool.ToolTip =
tool.CanBeDropped =
tool.RequiresHandle =
tool.Equipped:(enterBench)
tool.Unequipped:(exitBench)
tool
(name)
bp = player:()
(bp bp:(name)) (player.Character player.Character:(name))
()
bp = player:()
()
().Parent = bp
_, r (RECIPES)
owned[r.id] (r.toolName)
r.().Parent = bp
(input)
t = input.UserInputType
t == .UserInputType.MouseButton1 t == .UserInputType.Touch
(input)
inBench ready dragging
looseParts[step]
dragging =
dragIsTouch = input.UserInputType == .UserInputType.Touch
pointerPos = .(input.Position.X, input.Position.Y)
(input)
dragging
t = input.UserInputType
t == .UserInputType.MouseMovement t == .UserInputType.Touch
pointerPos = .(input.Position.X, input.Position.Y)
(catcher.InputBegan:((input)
(input) (input)
))
(catcher.InputChanged:(moveDrag))
(catcher.InputEnded:((input)
(input) ()
))
(UIS.InputChanged:(moveDrag))
(UIS.InputEnded:((input)
dragging (input) ()
))
(exitBtn.Activated:(()
hum = ()
hum hum:()
()
))
(cancelBtn.Activated:(()
active
(active.recipe.cost)
()
()
()
))
(player.CharacterAdded:(()
()
currentDim =
()
()
.()
()
))
env.__PortalGunCleanup = ()
()
currentDim homeCF
_, root = ()
root root.CFrame = homeCF
currentDim =
()
_, c (connections)
(() c:() )
_, o (objects)
(() o:() )
_, r (RECIPES)
_, name ({ r.toolName })
bp = player:()
bp bp:(name) bp[name]:()
player.Character player.Character:(name) player.Character[name]:()
_, name ({ })
bp = player:()
bp bp:(name) bp[name]:()
player.Character player.Character:(name) player.Character[name]:()
env.__PortalGunApplyLook =
()
()
()Get materials from dimensions Craft stuff with workbench like a portal gun or lantern

Universal