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

Getting all the possible positions of x and z axis on a part?

Im trying to make a automatic spawn where

I automatically spawn people ontop of a baseplate

But I can't figure out how to get all the exact positions for x and z axis of a part

I want to drop people ontop of the baseplate by like 10 studs high

I can do that but

I just need help getting all the possible positions of the x and z axis on a baseplate.

1 comment

0

What do you mean by "all the possible positions", do you mean you want to randomly spawn the players on the base plate, but at random areas of the baseplate?

1 answer

If you mean to randomly spawn them on different positions on the baseplate you can do

local xmin = --lowest x where the player can spawn to still be on the baseplate
local xmax = -- highest x where the player can spawn to still be on the baseplate
local yPosition = game.Workspace.BasePlate.Position.Y + Vector3.new(0,10,0) -- 10 studs above baseplate
local zmin = -- lowest z where the player can spawn to still be on the baseplate
local zmax = --highest z where the player can spawn to still be on the baseplate
character.Head.CFrame = CFrame.new(math.random(xmin, xmax), yPosition, math.random(zmin, zmax))

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