Yes. Heres my core script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local TeleportService = game:GetService("TeleportService")
local TweenService = game:GetService("TweenService")
local Events = ReplicatedStorage:WaitForChild("Events")
local Modules = ReplicatedStorage:WaitForChild("Modules")
local Functions = ReplicatedStorage:WaitForChild("Functions")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local CameraInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local FlashInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true)
local Camera = script.Parent.Camera
local safeTeleport = require(ServerScriptService.SafeTeleport)
local setDataRE = Remotes:WaitForChild("setData")
local MoveElevatorRE = Remotes:WaitForChild("MovingElevator")
local ElevatorEvent = Remotes:WaitForChild("Elevator")
local Elevator = script.Parent
local Shaft = Elevator:WaitForChild("Shaft")
local Prismatic = Shaft:WaitForChild("PrismaticConstraint")
local Config = Elevator:WaitForChild("Config")
local CountdownRunning = false
local Moving = false
local DisplayScreen = Elevator:WaitForChild("Screen").Display
local SurfaceUI = DisplayScreen:WaitForChild("SurfaceGui")
local Frame = SurfaceUI:WaitForChild("ScreenUI")
local BarBG = Frame:WaitForChild("BarBG")
local Bar = BarBG:WaitForChild("Bar")
local MapBanner = Frame:WaitForChild("MapBanner")
local MapName = Frame:WaitForChild("MapChosen")
local GameMode = Frame:WaitForChild("ModeChosen")
local Status = Frame:WaitForChild("Status")
local playersWaiting = {}
local function Setup()
playersWaiting = {}
Moving = false
local ColourToTween = Config.ColourToTween
local ChosenMode = Config.MapMode.Value
if ChosenMode == "Beginner" then
ColourToTween.Value = Color3.fromRGB(92, 255, 74)
elseif ChosenMode == "Intermediate" then
ColourToTween.Value = Color3.fromRGB(255, 140, 0)
elseif ChosenMode == "Hardcore" then
ColourToTween.Value = Color3.fromRGB(255, 19, 19)
end
GameMode.Text = string.upper(ChosenMode)
MapBanner.Image = Config.MapIcon.Texture
MapName.Text = Config.MapName.Value
TweenService:Create(GameMode, FlashInfo, {BackgroundColor3 = ColourToTween.Value}):Play()
local Calculation = #playersWaiting / Config.MaxPlayers.Value
TweenService:Create(Bar, CameraInfo, {Size = UDim2.new(Calculation, 0, 1, 0)}):Play()
end
local function TeleportPlayers()
local placeId = Config.PlaceID.Value
local server = TeleportService:ReserveServer(placeId)
local options = Instance.new("TeleportOptions")
options.ReservedServerAccessCode = server
for i,v in pairs(playersWaiting) do
setDataRE:FireClient(v, Config.MapName.Value)
end
safeTeleport(placeId, playersWaiting, options)
end
local function MoveElevator()
Moving = true
for i, player in pairs(playersWaiting) do
MoveElevatorRE:FireClient(player)
end
Status.Text = "[TELEPORTING PLAYERS!]"
TweenService:Create(Camera, CameraInfo, {CFrame = Camera.CFrame * CFrame.Angles(math.rad(-30), 0, 0)}):Play()
Prismatic.TargetPosition = -37
TeleportPlayers()
script.Parent.Platform.Lower:Play()
task.wait(10)
script.Parent.Platform.Rise:Play()
Prismatic.TargetPosition = 0
task.wait(8)
Setup()
end
local function RunCountdown()
countdownRunning = true
for i=10, 1, -1 do
Status.Text = "LOWERING IN [" .. i .. "] SECONDS."
task.wait(1)
if #playersWaiting < 1 then
countdownRunning = false
Setup()
return
end
end
MoveElevator()
countdownRunning = false
end
Elevator.Entrance.Touched:Connect(function(part)
local player = Players:GetPlayerFromCharacter(part.Parent)
local isWaiting = table.find(playersWaiting, player)
if player and not isWaiting and #playersWaiting < Config.MaxPlayers.Value and not Moving then
table.insert(playersWaiting, player)
MapBanner.Image = Config.MapIcon.Texture
MapName.Text = Config.MapName.Value
GameMode.Text = string.upper(Config.MapMode.Value)
BarBG.PlayerCount.Text = #playersWaiting .. " / " .. Config.MaxPlayers.Value
player.Character.PrimaryPart.CFrame = Elevator.TeleportIn.CFrame
local Calculation = #playersWaiting / Config.MaxPlayers.Value
TweenService:Create(Bar, CameraInfo, {Size = UDim2.new(Calculation, 0, 1, 0)}):Play()
ElevatorEvent:FireClient(player, Elevator)
if not countdownRunning then
RunCountdown()
end
end
end)
ElevatorEvent.OnServerEvent:Connect(function(player)
local isWaiting = table.find(playersWaiting, player)
if isWaiting then
table.remove(playersWaiting, isWaiting)
end
MapBanner.Image = Config.MapIcon.Texture
MapName.Text = Config.MapName.Value
GameMode.Text = string.upper(Config.MapMode.Value)
BarBG.PlayerCount.Text = #playersWaiting .. " / " .. Config.MaxPlayers.Value
player.Character.PrimaryPart.CFrame = Elevator.TeleportIn.CFrame
local Calculation = #playersWaiting / Config.MaxPlayers.Value
TweenService:Create(Bar, CameraInfo, {Size = UDim2.new(Calculation, 0, 1, 0)}):Play()
if player.Character then
player.Character.PrimaryPart.CFrame = workspace.TeleportOut.CFrame
end
end)
Setup()
Events.RefreshMap.Event:Connect(Setup)