Right now i have a script that teleports all players when one person touches a button. I would like that when someone touches the button it teleports all players who are touching a transparent cannot collide brick. Please can someone give me a lot of help not just like little clues as i am fairly new to scripting. Here is the snippet of my code that teleports everyone
local target = CFrame.new(19.756, 82.351, 18.742) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do
--Make sure the character exists and its HumanoidRootPart exists
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
--add an offset of 5 for each character
player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
end
end

1 comment
he wants only to teleport the ppl inside a part when a presses a button, not make a part keep on teleporting ppl after he presses a button