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

How to find the positions within a part?

The title may be a bit confusing, but let's take the default Baseplate for example. I'm making a part appear randomly on that Baseplate, so I used a part to take measurements of the ends of it, if that makes any sense. Is there a way to find the measurements via scripting? Comment if you are a bit confused.

Script:


function snow()
	while wait() do
-- got here try 1
	a = game.Lighting.Part:clone()
	print('cloned')
	for i,v in pairs(game.Workspace:GetChildren()) do
		if v.Name == "Baseplate" then
			a.Position = Vector3.new(math.random(-257,257), 200, math.random(-254,254))
		end
	end
	game.Workspace["Snow Script"].Script:clone().Parent = a
	a.Parent = Workspace
	a.Script.Disabled = false
	print('set')
	end
end

snow()

3 comments

0

I'm a bit confused, do you mean finding the position under the properties of a part?

0

So you want the positions of each corner of the part? Or the size of the part?

0

Just posted script. So, Line 8 positions the part, but the X and Z I put in is the X and Z of the lowest/highest corners

2 answers

I'm a bit confused, do you mean finding the position under the properties of a part? If so, this might work. Don't downvote me if it doesn't work please.

Part = game.Workspace.Part --You can change this to your parts name.

Position = Part.Position --This is where you would find the position of "Part". Using Part.Position should go into the properites of that part and look under Position.

1 comment

0

Not exactly. Check updated question

Basically, I think you need to find the part's position or

Game.Workspace.insertpartnamehere.Position

So, you need to make the script recognize what the position is. Consult the Wiki for that, I just started scripting ;) Good luck!

1 comment

0

Not exactly

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