Thank you for using our website
Your script:
local player = game.Players.LocalPlayer
for i = 1, 50 do
local spawnPads = workspace.SpawnPadModel.SpawnPads:GetChildren()
local checkpoint = spawnPads[i]
if checkpoint then
local goObject = checkpoint:FindFirstChild("Part") -- Look for an object named "Part" inside the checkpoint
if goObject then
local character = player.Character
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
humanoidRootPart.CFrame = goObject.CFrame -- Teleport to the "Part" object's CFrame
wait(0.1)
else
warn("Object 'Part' not found inside checkpoint:", checkpoint.Name)
end
else
warn("Checkpoint not found at index:", i)
end
end
wait(2) -- Wait for 2 seconds before teleporting to "go" objects
local function teleportToGoObjectsInGroup(group)
local goObjects = group:GetDescendants()
local character = player.Character
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
for _, goObject in ipairs(goObjects) do
if goObject.Name == "go" and goObject:IsA("BasePart") then
humanoidRootPart.CFrame = goObject.CFrame
wait(0.1)
end
end
end
local function searchForGoObjects()
for _, group in ipairs(workspace:GetChildren()) do
if group:IsA("Model") then
teleportToGoObjectsInGroup(group)
end
end
end
searchForGoObjects()