Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local common = ReplicatedStorage.common
local hitIsYou = require(common.util.hitIsYou)
local ParticleCreator = require(common.ParticleCreator)
local SoundHelper = require(common.SoundHelper)
local root = script.Parent
local telegroup = root.telegroup
local keyslots = root.keyslots
local keysInOrder = {
keyslots.slots.Red,
keyslots.slots.Green,
keyslots.slots.Blue,
}
local isOpen = false
local function destroyKeySlot(slot)
coroutine.wrap(function()
CollectionService:RemoveTag(slot, "floaty")
ParticleCreator.Presets.explode(slot.CFrame)
SoundHelper.playSoundAt(slot.CFrame, "magic")
slot:Destroy()
end)()
end
local function openPortal()
if isOpen then return end
isOpen = true
local ts = game:GetService("TweenService")
-- animate key slots exploding
for _, slot in pairs(keysInOrder) do
destroyKeySlot(slot)
wait(0.3)
end
-- animate white sphere charging
keyslots:Destroy()
ParticleCreator.spawnParticle("vacuum", {
cFrame = root.Portal.Part.CFrame,
scale = root.Portal.Part.Size.Magnitude * 0.75,
amount = 1,
timeScale = 0.8,
})
SoundHelper.playSoundAt(root.Portal.Part.CFrame, "portal_open", {
delay = 0.8
})
wait(1)
SoundHelper.playSoundAt(root.Portal.Part.CFrame, "portal_loop")
-- animate portal opening explosion
root.Portal.Part.Mesh.Scale = Vector3.new(0,0,0)
root.Portal.Part.Color = Color3.new(1,1,1)
local OPENING_DURRATION = 0.4
local FADE_DURRATION = 2
local scaleTweenInfo = TweenInfo.new(OPENING_DURRATION, Enum.EasingStyle.Quint, Enum.EasingDirection.In)
local colorTweenInfo = TweenInfo.new(FADE_DURRATION, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut,0,false,1)
ts:Create(root.Portal.Part.Mesh, scaleTweenInfo, {Scale = Vector3.new(1,1,1)}):Play()
ts:Create(root.Portal.Part, colorTweenInfo, {Color = Color3.new(0,0,0)}):Play()
wait(OPENING_DURRATION-0.1)
CollectionService:AddTag(telegroup, "teleporter_group")
SoundHelper.playSoundAt(root.Portal.Part.CFrame, "lightning")
root.Portal.emitters.FullPart.Big:Emit(10)
root.Portal.emitters.FullPart.Small:Emit(10)
root.Portal.emitters.FullPart.Fast:Emit(100)
root.Portal.emitters.HalfPart.VeryFast:Emit(20)
root.Portal.emitters.FullPart.Big.Enabled = true
root.Portal.emitters.FullPart.Small.Enabled = true
end
local function setupTeleportGroup()
for k,v in pairs(telegroup:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 1
end
end
end
return function(clientSession)
local store = clientSession.store
local api = clientSession.api
root.Trigger.Touched:Connect(function(hit)
if hitIsYou(hit) then
local hasAllKeys = (
clientSession:getGameFlag("hasRedKey") and
clientSession:getGameFlag("hasGreenKey") and
clientSession:getGameFlag("hasBlueKey")
) or RunService:IsStudio()
if hasAllKeys then
openPortal()
end
end
end)
root.Trigger.Transparency = 1
setupTeleportGroup()
end
@accurateisaiah

This comment has been minimized.

Copy link

@accurateisaiah accurateisaiah commented May 31, 2020

His last code.

@PlanetNoobGotHacked

This comment has been minimized.

Copy link

@PlanetNoobGotHacked PlanetNoobGotHacked commented Jun 1, 2020

this is sad

@kuoves1506

This comment has been minimized.

Copy link

@kuoves1506 kuoves1506 commented Jun 1, 2020

rip...

this is very sad.

@Playerealw

This comment has been minimized.

Copy link

@Playerealw Playerealw commented Jun 1, 2020

:(

@PlanetNoobGotHacked

This comment has been minimized.

Copy link

@PlanetNoobGotHacked PlanetNoobGotHacked commented Jun 1, 2020

@CH5RLIEE

This comment has been minimized.

Copy link

@CH5RLIEE CH5RLIEE commented Jun 3, 2020

rest in fucking peace man.

@PlanetNoobGotHacked

This comment has been minimized.

Copy link

@PlanetNoobGotHacked PlanetNoobGotHacked commented Jun 4, 2020

whenever you comment it says its been updated

@PlanetNoobGotHacked

This comment has been minimized.

Copy link

@PlanetNoobGotHacked PlanetNoobGotHacked commented Jun 4, 2020

Something fishy... this has been edited yesterday

@fuhguf2

This comment has been minimized.

Copy link

@fuhguf2 fuhguf2 commented Jun 5, 2020

rest well austin...

@GalaticInspired

This comment has been minimized.

Copy link

@GalaticInspired GalaticInspired commented Jun 5, 2020

:(

@BloxDev-RBLX

This comment has been minimized.

Copy link

@BloxDev-RBLX BloxDev-RBLX commented Jun 13, 2020

Rest in peace Nimblz

@botmaker69

This comment has been minimized.

Copy link

@botmaker69 botmaker69 commented Jun 27, 2020

We will remember you, Nimblz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment