local TeleportService = game:GetService("TeleportService")
local teleportID = 14627040487
local textLabel = workspace.Sign.Text.SurfaceGui.Frame.TextLabel
local zone = script.Parent --// the part encasing the floor pad
local timer = 30
local PlayerTable = {}
while task.wait(1) do
PlayerTable = {}
timer -=1
print(timer)
textLabel.Text = ("Boat Departing in "..timer)
if timer == 0 then
timer = 0
local parts = workspace:GetPartsInPart(zone) --// get the parts inside of the zone
for _, part in parts do
local model = part:FindFirstAncestorOfClass("Model") --// check if the character model exists
if model and model:FindFirstChildOfClass("Humanoid") then --// check if the model has a humanoid
local player = PlayersService:GetPlayerFromCharacter(model) --// check if the character is a player
if player and table.find(PlayerTable, player) == nil then
table.insert(PlayerTable,player) --// add them to the table
end
end
end
if #PlayerTable > 0 then
TeleportService:TeleportAsync(teleportID, PlayerTable) --// teleport them
end
task.wait(1)
timer = 30 -- restart the cycle
end
end