| |
|
|
| 02 Aug 2014 12:31 PM |
part = PART i = part.Position X = i.X.Scale + l Y = i.Y.Scale + l Z = i.Z.Scale + l |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Aug 2014 12:36 PM |
| Define what is "around the part" Define what you're trying to do better. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Aug 2014 12:46 PM |
So you're trying to make a puzzel game with tiles... For each part insert a value with a specific number (or use names) then check if the parts are in order respected to the Vector3 it's at. It is much better than checking globally around something.
Suedo-Code: -- Assuming this script is by the parts local Parts = script.Parent.Parts local NumParts = #Parts:GetChildren() local Checked = 0
local win = function() print("You win!") end
local checkWin = function() Checked = 0 for _, v in pairs(Parts:GetChildren())do local loc = {} for _, n in string.gmatch(v.Name, "[^%,]+")do table.insert(loc, tonumber(n)) end if(v.Position.X == loc[0]) and (v.Position.Z == loc[1])then Checked = Checked + 1 end end if(Checked == NumParts)then win() end end |
|
|
| Report Abuse |
|
|