Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I randomly select a part? [Unsolved]

Asked by
NecoBoss 194
9 years ago

I want a player to be teleported to a random part in a model. I tried this but it doesn't work:

-- Note this is a fragment of a script that works with normal positions
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(math.random(game.Workspace.Spawns:GetChildren().Position))
0
I'll help! Just wait. fireboltofdeath 635 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago
game.Players.LocalPlayer.Character:MoveTo(Vector3.new(math.random(game.Workspace.Spawns:GetChildren().Position)))

Hope I helped!

0
~~~ Happy scripting ~~~ You can't see whole script so just use the copy button when you put your mouse over the code. fireboltofdeath 635 — 9y
0
Didn't work NecoBoss 194 — 9y
0
Put in localscript. fireboltofdeath 635 — 9y
Ad

Answer this question