MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 22 May 2012 05:54 PM |
What does that mean? I get that with this function:
function onClick() hasBldng = false if canPlace == true then if _G["curBldng"] ~= nil then table.insert(posTable, N.Position) print(posTable) newBldng = bldngDir:findFirstChild(_G["curBldng"]):clone() newBldng.Parent = game.Workspace if newBldng:findFirstChild("isPlaced") then newBldng.isPlaced.Value = true end function MoveModel(Model, Cframe, Part) local primary = Part or Model:GetChildren()[math.random(1, #Model:GetChildren())] local CF = Cframe or CFrame.new(0,0,0) local rX, rY, rZ = primary.CFrame:toEulerAnglesXYZ() local dif = { } local rot = { } local parts = { } wait() allChildren(Model, parts, dif, rot, primary) primary.CFrame = CF * CFrame.fromEulerAnglesXYZ(rX, rY, rZ) for _, v in pairs(rot) do parts[_].CFrame = (CFrame.new(dif[_]) + CF.p) * v end end
function allChildren(Model, p, d, r, primary) for _, v in pairs(Model:GetChildren()) do if v ~= primary and v:IsA("BasePart") then table.insert(p, v) table.insert(d, CFrame.new(primary.CFrame.p):pointToObjectSpace(v.Position)) table.insert(r, CFrame.fromEulerAnglesXYZ(v.CFrame:toEulerAnglesXYZ())) end allChildren(v) end end MoveModel( newBldng, (N.CFrame), newBldng.centerPart ) end end end end
MrMcAero |
|
|
| Report Abuse |
|
|
| 22 May 2012 06:04 PM |
I think you have 3 extra ends, although you might want to double-check.
† KMXD † |
|
|
| Report Abuse |
|
|
| 22 May 2012 06:06 PM |
Er, only one extra end.
† KMXD † |
|
|
| Report Abuse |
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 22 May 2012 07:23 PM |
After removing an end:
end expected to close function at line:xxx
MrMcAero |
|
|
| Report Abuse |
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 22 May 2012 07:35 PM |
Fixed my problem. I had a bad line of code. :\
MrMcAero |
|
|
| Report Abuse |
|
| |