Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to teleport selected children?

continue the script: Game.Players.mathrandom.GetChildren let the children have been selected but it is necessary that this selected children be teleported to the coordinates -687.5, 34.7, 520.5

2 comments

0

So you're wanting a random user to be teleported to the coordinates?

0

yes

2 answers

✓ Accepted answer

This will choose a random player and teleport them to the location

local plrs = game.Players:GetPlayers()
local chosenPlr = plrs[math.random(1,#plrs)] --set chosenPlr to a random player
if chosenPlr.Character and chosenPlr.Character:FindFirstChild("HumanoidRootPart") then
   chosenPlr.Character.HumanoidRootPart.CFrame = CFrame.new(-687.5, 34.7, 520.5)
end

2 comments

0

He wants to select players

0

GOOD!!! WORKED!!! THANKS YOU!!!

Assuming that plrs are the selected Players

Local location = yourcoordshere
for i,v in pairs(plrs) do
pcall(function()
v.Character.Torso.CFrame = CFrame.new(location)
end)
end

Please let me know if this works. Make sure to upvote if it does. This script might be subject to errors

2 comments

0

if I'm writing Game.Players.mathrandom.GetChildren Local location = yourcoordshere for i, v in pairs (plrs) do pcall (function () v.Character.Torso.CFrame = CFrame.new (location) end) end then the word "Local" is highlighted in red and if I write Local location = yourcoordshere for i, v in pairs (plrs) do pcall (function () v.Character.Torso.CFrame = CFrame.new (location) end) end then the word

0

coordinats i too write

This discussion is preserved as it was. New answers, comments, and votes are closed.