How to position player relative to a part unregarding its orientation

I’m making an RPG game that spawns an arena to fight the boss at a random position when you touch a button. Then, you get TP’ed to the arena, along with the boss. However, I want to ensure you get TP’ed and spawn at a certain location inside the part’s bounds. I want to make it so the player spawns 5% farther away from the start of the arena. I want to position the player without considering the orientation of the arena.

What I want to do:

What it ends up happening:

The positioning script:

	local min, max = 0, 1000
	local alcance = 100

	local Mobclone =  Mob:Clone()
	local Mapclone = Mapa:Clone()

	local Map = Mapclone.Mapa

	local rx, ry, rz
	local GetPartBounds

	repeat

		rx, ry, rz = math.random(min, max), math.random(min, max), math.random(min, max)
		GetPartBounds = workspace:GetPartBoundsInBox(CFrame.new(rx, ry, rz), Vector3.new(alcance, alcance, alcance))

	until not next(GetPartBounds)

	local Pos = Vector3.new(rx, ry, rz)

	Mapclone.Parent = localF

	Mapclone:MoveTo(Pos)
	
	local Position = Mapa.Position
	local Size = Mapa.Size

	local PX, PY, PZ = Position.X - (Size.X/2 + Size.X * .05), Position.Y + .5, Position.Z

	local plrspawner = Vector3.new(PX, PY, PZ)
	
	char:MoveTo(plrspawner)

i really need an answer. If you want to help feel free to

The -Z direction is forward. -X is left +X is right. From your pictures it looks like you want to move your character in the +Z direction, but your calculation moves the character in the negative X direction.
So, maybe you want something like this:

local PX, PY, PZ = Position.X, Position.Y+15, Position.Z + Size.Z/2-Size.Z * .05

it may work but if I change the orientation, the Z axis would be the “X” axis or vice-versa

Do you want the player to rotate with the arena or always look into the screen?
I’m guessing you want to rotate with the arena, since the starting place will do that.
Then something like this:

local Mapa =workspace.Baseplate
local char:Model =script.Parent

local min, max = 0, 1000
local alcance = 100

--local Mobclone =  Mob:Clone()
local Mapclone = Mapa:Clone()
Mapclone.Color = Color3.new(0, 0.333333, 0)
--local Map = Mapclone.Mapa



local rx, ry, rz
local GetPartBounds

repeat

	rx, ry, rz = math.random(min, max), math.random(min, max), math.random(min, max)
	ry = 10	
	GetPartBounds = workspace:GetPartBoundsInBox(CFrame.new(rx, ry, rz), Vector3.new(alcance, alcance, alcance))

until not next(GetPartBounds)

local Pos = Vector3.new(rx, ry, rz)

Mapclone.Parent = workspace

--Mapclone:MoveTo(Pos)
Mapclone:PivotTo(CFrame.new(Pos) * CFrame.Angles(0,math.pi,0))

local Position = Mapclone.Position
local Size = Mapclone.Size

--local PX, PY, PZ = Position.X, Position.Y+15, Position.Z + Size.Z/2-Size.Z * .05
local PX, PY, PZ = 0, 15, Size.Z/2-Size.Z * .05

local plrspawner = Vector3.new(PX, PY, PZ)

char:PivotTo(Mapclone:GetPivot() * CFrame.new(plrspawner))

With this code the player should always spawn across from the front or 5% from the rear. Note: some of the changes were just so it would be testable in a new workspace, so ignore those.