Dinobird
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 213 |
|
|
| 27 Nov 2012 06:26 PM |
Tool = script.Parent p = Tool.Parent.Parent personalbuildings = (game.Workspace:FindFirstChild(p.Name .. "'s Structures"))
function onButton1Down(mouse) if personalbuildings:FindFirstChild(CraftingBench) == nil then model = game.Objects.Structures.CraftingBench:clone() model.Parent = personalbuildings model:MakeJoints() model:MoveTo(mouse.hit.p) elseif personalbuildings:FindFirstChild(CraftingBench) then personalbuildings:FindFirstChild(CraftingBench):MoveTo(mouse.hit.p) end end
function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
Tool.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 27 Nov 2012 06:28 PM |
| personalbuildings does not exist when the script is run. I would suggest an if line to prevent this. |
|
|
| Report Abuse |
|
|
Dinobird
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 213 |
|
|
| 27 Nov 2012 06:39 PM |
| But it does though? Let me just try it again... |
|
|
| Report Abuse |
|
|
Dinobird
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 213 |
|
|
| 27 Nov 2012 06:41 PM |
| Nope, it exists when the script is run. |
|
|
| Report Abuse |
|
|