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

How to find the positions within a part?

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

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()
0
I'm a bit confused, do you mean finding the position under the properties of a part? Relatch 550 — 9y
0
So you want the positions of each corner of the part? Or the size of the part? Tkdriverx 514 — 9y
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 Shawnyg 4330 — 9y

2 answers

Log in to vote
0
Answered by
Relatch 550 Moderation Voter
9 years ago

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.
0
Not exactly. Check updated question Shawnyg 4330 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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!

0
Not exactly Shawnyg 4330 — 9y

Answer this question