Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
|
| 20 Apr 2014 10:05 AM |
The output says: attempt to call method "remove" (a nil value).
Here's the function that the error is in.
function removeBricks(map) loading = true
for i,v in pairs(workspace[map]:GetChildren()) do Workspace.Generator.Connection.Part = v wait() v:remove() --It works fine here end
Workspace.Generator.Connection.Part = nil map:remove() --But errors here. loading = false end
In the for loop, I'm deleting all the bricks in the model, then I'm removing the model. The bricks remove fine, but the model doesn't. |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2014 10:06 AM |
if map then map:Destroy(); end |
|
|
| Report Abuse |
|
|
Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
|
| 20 Apr 2014 10:13 AM |
| Thanks for trying to help, but I found the problem. 'map' is a string, and I forgot to do workspace[map]. You can't :remove() a string! |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2014 10:14 AM |
You can.
String = Instance.new("StringValue",game.Workspace); String.Value = "This is a string."; Delay(0,(function() String:Destroy() end)) |
|
|
| Report Abuse |
|
|