Make stuff not spawn on top of eachother

Hey there, I am working on a script that will spawn cars. I’d like to know if there is a way I could make it so the script will detect if something is in the area where the car would spawn, and if there is, make a little TextLabel pop up saying something like “Something is in the spawn area, move it then try again.” This is the script I have, I have tried looking around for answers, but I can’t find anything.

script.Parent.MouseButton1Click:Connect(function(GetCar)
local Mod = game.ServerStorage.Cars1.dpi6
local clone = Mod:Clone()
	clone.Parent = workspace
	clone:MakeJoints()
	script.Parent.Parent.Parent.Enabled = false
end)
2 Likes

I’d recommend using Region3 and checking if there are parts within the designated region, and if there aren’t parts then run your desired spawn script.

More information on Region3 and more specific information about finding parts in them can be found here:

1 Like

Hey I made a model a few months ago if you want you can skid scripts off of it. I am just to lazy to copy and paste the scripts and get into detail. Vehicle With spawner - Roblox

1 Like

I would play around with it, but you have the model locked : /

1 Like

Shoot my bad I will unlock it rn, its not exactly like what you said but I can attempt to make it like what you said rq if you want me to