Basically, I have this script that creates pedestals according to the number of players in the game, and when a certain number of players are in the game, I want the script to teleport all the players onto a different pedestal.
UPDATE: I have written a script with the help of Royaltoe, but when the player teleports to the pedestal, they are clipped inside of it then pop out, I just want them to be standing immediately. I tried editing the position of the CFrame, but i am not having any luck. Any help is greatly appreciated!
--getting the "Players" service
local Players = game:GetService("Players")
local function teleportPlayer(character, index)
wait(0.5)
local numPlayers = #game.Players:GetPlayers()
local pedestal = workspace:FindFirstChild("CompletedPedestal_"..index)
local HumanoidRootPart = character.HumanoidRootPart
HumanoidRootPart.CFrame = pedestal.PedestalBase.CFrame * CFrame.new(Vector3.new(0, 0 , 0))
end
local function onPlayerAdded(player)
local players = game.Players:GetChildren()
local minPlayers = 4
--check if we have enough players
if #players >= minPlayers then
wait(6)
--loop thru the players in the players table
for index, player in pairs(players) do
--if the player's character exists
if player.Character then
--teleport the player to their pedestal
teleportPlayer(player.Character, index)
end
end
end
local numPlayers = #game.Players:GetPlayers()
end
local function onPlayerRemoved()
local numPlayers = #game.Players:GetPlayers()
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
game.Players.PlayerRemoving:Connect(onPlayerRemoved)

2 comments
When do you want to teleport the player to the pedestal? On start? Use game.Players.PlayerAdded
no, i want it to teleport a bunch of players to their own pedestal when there is a certain amount of players in the game. I already know how to handle the amount of players in the game, I just don't know how to actually teleport the characters.