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

How do I make someone tele randomly? [closed]

Asked by
Jash50 5
10 years ago

I mean, how do I make someone tele in that certain area randomly?

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 10 years ago

By randomly do you mean at a random time or to a random position?

If you mean to a random position on a part, you could do the following:

local plr = game.Players.Player1
local part = workspace.Part

repeat wait() until plr.Character

local randx = math.random(part.Position.X - part.Size.X/2, part.Position.X + part.Size.X/2)
local randy = part.Position.Y + 3
local randz = math.random(part.Position.Z - part.Size.Z/2, part.Position.Z + part.Size.Z/2)

plr.Character:MoveTo(Vector3.new(randx, randy, randz))
0
Yes, I mean random position on a part, thanks. Jash50 5 — 10y
Ad