|
| 13 Jul 2014 07:29 AM |
script: local baseplate = Instance.new("Part", game.Workspace) baseplate.Name = "Plate" local sample = Instance.new("Part", game.Workspace) baseplate.Position = Vector3.new(81, 46.2, -138) baseplate.Rotation = sample.Rotation baseplate.Size = Vector3.new(512, 1.2, 512) baseplate.BrickColor = BrickColor.new("Bright green") baseplate.Anchored = true baseplate.Locked = true sample:remove() local spawnlocation = Instance.new("SpawnLocation", game.Workspace) spawnlocation.Name = "Spawner" spawnlocation.Position = baseplate.Position spawnlocation.Transparency = 1 spawnlocation.CanCollide = false spawnlocation.Locked = true spawnlocation.Anchored = true spawnlocation.Locked = true
game.Workspace:ClearAllChildren(game.Workspace.Spawner, game.Workspace.Plate)
It's supposed to create a baseplate with an instance of a SpawnLocation in the center of it, and then clear everything off workspace except Workspace.Spawner and Workspace.Plate
Did I do anything wrong?
-Common sense doesn't exist |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 07:36 AM |
http://wiki.roblox.com/index.php?title=API:Instance/ClearAllChildren
I don't see any parameters for this API - such as for resuscitation.
:ClearAllChildren() will clear all children regardless of any pseudo parameters. You will have to copy-paste it before clearance.
|
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 07:41 AM |
(putting parameters in it, I feel stupid now)
Yea, but if I put the :ClearAllChildren() before my create the baseplate and the spawnpoint, still, nothing is there under Workspace.
No parts, just a terrain and camera.
-Common sense doesn't exist |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jul 2014 07:53 AM |
wait(2) game.Workspace:ClearAllChildren() wait()
baseplate = Instance.new("Part", game.Workspace) baseplate.Name = "Plate" sample = Instance.new("Part", game.Workspace) baseplate.Position = Vector3.new(81, 46.2, -138) baseplate.Rotation = sample.Rotation baseplate.Size = Vector3.new(512, 1.2, 512) baseplate.BrickColor = BrickColor.new("Bright green") baseplate.Anchored = true baseplate.Locked = true sample:remove()
spawnlocation = Instance.new("SpawnLocation", game.Workspace) spawnlocation.Name = "Spawner" spawnlocation.Position = baseplate.Position spawnlocation.Transparency = 1 spawnlocation.CanCollide = false spawnlocation.Locked = true spawnlocation.Anchored = true spawnlocation.Locked = true
Eh', so it waits for 2 seconds, then clears all children (i wanted to that happen), then it waits for a tick and then creates the stuff. If I don't put in the :ClearAllChildren(), the baseplate is created. Is there something I'm missing that's supposed to break out of the argument (:ClearAllChildren())
-Common sense doesn't exist |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 13 Jul 2014 07:53 AM |
you're clearing all the children from the workspace... game.Workspace.Model:ClearAllChildren() or whatever the path is |
|
|
| Report Abuse |
|
|
Waffloid
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1606 |
|
|
| 13 Jul 2014 07:56 AM |
Instead of the ClearAllChildren, copy this code at the beggining.
function ClearAllChild(pos,name) for i,v in pairs(pos:GetChildren()) do if v.Name == name then v:Destroy() end end end
So, if you want to remove all the parts named Spawner then you will write ClearAllChild("Billy","Spawner").
Just make sure that it is not a object value, and you have that little code at the top.
~Swagilitious and not Nutricious~ |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 08:01 AM |
Ok, so I started a little bit of coding on top of the creation of the baseplate and spawnpoint, and I did this:
model = game.Workspace:GetChildren() modelParent = Instance.new("Model", game.Workspace) modelParent.Name = "ModelWorkspace" model.Parent = game.Workspace.ModelWorkspace modelParent:ClearAllChildren()
Now, that bit of code makes the model and names it, ModelWorkspace, but it has no children after the bit of code is executed.
-Common sense doesn't exist |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 08:07 AM |
@WaffLoid: Nope, the baseplate and spawnpoint is created but, the 6 parts I put under Workspace isn't removed.
omg, this problem is going to give me headaches.
Here's the problem, again:
I want the script to remove everything in Workspace first and create a baseplate and spawnpoint in the middle of it, however, after the script removes everything in Workspace, nothing appears in Workspace.
-Common sense doesn't exist |
|
|
| Report Abuse |
|
|
Waffloid
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1606 |
|
|
| 13 Jul 2014 08:12 AM |
Oh, I forgot! it was like this
ClearAllChild(game.Workspace,"Player","cheese")
~Swagilitious and not Nutricious~ |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 08:15 AM |
Eh, in what location is this script?
If its in workspace it'll get deleted to.
|
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 08:40 AM |
@above: Then how da heck am I supposed to do this?
-Common sense doesn't exist |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 09:03 AM |
| Make it a LocalScript somewhere in your player. Perhaps a tool, GUI, or have a relay network to resurrect your code. |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 09:42 PM |
^ Wouldn't my character and the localscript be deleted also?
Sword Dancing at Fat Camp With Starwars Kid |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2014 07:12 AM |
@Drake0: I figured out what you mean, and I tried doing it, but I ended up with a non-responsive Roblox Studio.
Sword Dancing at Fat Camp With Starwars Kid |
|
|
| Report Abuse |
|
|