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

How would I go about randomizing the position of an object spawned to Workspace?

Asked by 9 years ago

Basically what I am trying to do is spawn a cloud that has killing rain. What I want the cloud to do is spawn on a random side of a map at a random spot with a height of 95 and slowly move inward. I am really stuck with this and would appreciate it if someone gave me some tips on utilizing randomization.

1 answer

Log in to vote
0
Answered by 9 years ago

check what the position of 'z' is on one side of the map, then add the "z" size of the map to it to get the second integer for the random function, so it basically is math.random(z, z+sizeofmap) then do the same with "x"

0
Thanks, this seems to be what I was looking for. One question I have though is, what do you mean by sizeofmap? Are you just referring to like the distance from one side of the map to the other (As in 'math.random(200,300)' for the z-axis)? megamario640 50 — 9y
0
yes, i am, TheGreatRobloxianWar 0 — 9y
Ad

Answer this question