Adam2090
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 889 |
|
|
| 06 Nov 2013 05:38 PM |
I can't seem to figure out why this doesn't work. No output error. It just doesn't clone. Maybe it has something to do with the zombie being a humanoid? Script: if game.Workspace:findFirstChild("Zombie", false) then game.Lighting.Zombie:clone().Parent = game.Workspace end
|
|
|
| Report Abuse |
|
|
|
| 06 Nov 2013 05:41 PM |
| Don't there need to be a "==" for the if line? |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2013 05:41 PM |
What you are telling your Script to do is go find an Instance named "Zombie" in Workspace, and if it finds it to clone an Instance from Lighting into Workspace. The reason this probably doesn't work is that you have no model in Workspace named "Zombie".
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Merilo
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 500 |
|
|
| 06 Nov 2013 05:42 PM |
Maybe the zombie is set to archivable???
also make sure it is a loop |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2013 05:42 PM |
@rosie92680 Nope. "==" is just used to turn something into a boolean. For example:
print(type(game.Workspace.Name == "Workspace")) > boolean
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Adam2090
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 889 |
|
|
| 06 Nov 2013 05:43 PM |
@Nelson Really? I thought the ", false" part means that if it can't find Zombie. |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2013 05:44 PM |
Nope. The second argument determines whether or not the search is recursive. For example, let's say you have a Part in Workspace:
print(game:FindFirstChild("Part", false)) > nil print(game:FindFirstChild("Part", true)) > Part
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Adam2090
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 889 |
|
|
| 06 Nov 2013 05:47 PM |
| Okay, so how would I make the script detect if there is a "Zombie" in Workspace? |
|
|
| Report Abuse |
|
|
Merilo
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 500 |
|
|
| 06 Nov 2013 05:48 PM |
| i was about to say that the false was redundant, but didn't want to waste time/maybe you know what you're doing. |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2013 05:48 PM |
if (game.Workspace:FindFirstChild("Zombie")) then -- There is a Zombie in Workspace else -- There is not a Zombie in Workspace end
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Merilo
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 500 |
|
|
| 06 Nov 2013 05:51 PM |
while game.Lighting:FindFirstChild("Zombie") do if workspace:FindFirstChild("Zombie") then if not game.Lighting.Zombie.Archivable then game.Lighting.Zombie.Archivable = true end game.Lighting.Zombie:Clone().Parent = workspace end wait(1) end |
|
|
| Report Abuse |
|
|