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
10 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:

01function snow()
02    while wait() do
03-- got here try 1
04    a = game.Lighting.Part:clone()
05    print('cloned')
06    for i,v in pairs(game.Workspace:GetChildren()) do
07        if v.Name == "Baseplate" then
08            a.Position = Vector3.new(math.random(-257,257), 200, math.random(-254,254))
09        end
10    end
11    game.Workspace["Snow Script"].Script:clone().Parent = a
12    a.Parent = Workspace
13    a.Script.Disabled = false
14    print('set')
15    end
16end
17 
18snow()
0
I'm a bit confused, do you mean finding the position under the properties of a part? Relatch 550 — 10y
0
So you want the positions of each corner of the part? Or the size of the part? Tkdriverx 514 — 10y
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 — 10y

2 answers

Log in to vote
0
Answered by
Relatch 550 Moderation Voter
10 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.

1Part = game.Workspace.Part --You can change this to your parts name.
2 
3Position = 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 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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

1Game.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 — 10y

Answer this question