|
| 12 Feb 2017 01:57 AM |
| Want the script to search in Workspace for the NPC and if there is none then to begin another round via while true do loop. |
|
|
| Report Abuse |
|
|
Prenup
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 01:58 AM |
game.Workspace:FindFirstChild("NPCName")?
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 02:01 AM |
Oh thanks.
but if it doesn't find any it would be like this?
while true do game.Workspace:FindFirstChild("NPCName") if childnotfound then StartRound()
end
What would I put if it doesn't find the child? |
|
|
| Report Abuse |
|
|
Prenup
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 02:03 AM |
I'm sure this would work
while true do if not game.Workspace:FindFirstChild("NPCName") then
StartRound() end end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Feb 2017 02:09 AM |
while true do game.Workspace:FindFirstChild("ZombieReg") else StartRound()
wait(2) end end
I believe this might work |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 02:12 AM |
| while true do game.Workspace:FindFirstChild("ZombieReg") wait(1) if "ZombieReg" ## nil then StartRound() This works better |
|
|
| Report Abuse |
|
|
Prenup
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 02:13 AM |
That wouldn't work...
Are you sure its not the StartRound() function thats causing an error?
What does the output say?
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 02:15 AM |
| Output has no errors or anything |
|
|
| Report Abuse |
|
|
Prenup
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 02:18 AM |
If you haven't solved your problem yet could you please post the full script.
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 02:20 AM |
function StartRound() --Begin script.Parent.Parent.Lighting.Zombies:Clone() end
while true do game.Workspace:FindFirstChild("ZombieReg") wait(1) if "ZombieReg" == nil then StartRound() wait(2) end end
This is full script |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 12 Feb 2017 02:21 AM |
| while wait() do if not workspace:FindFirstChid('ZombieReg') then ############### round...') StartRound() else ############ is not over...') wait(2) end end |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 12 Feb 2017 02:23 AM |
| Thanks a lot, ROBLOX is filtering way too much on the forums. |
|
|
| Report Abuse |
|
|
Prenup
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 02:24 AM |
function StartRound() --Begin newZombie = game.Lighting.Zombies:Clone() newZombie.Parent = game.Workspace end
while true do if not game.Workspace:FindFirstChild("ZombieReg") then wait(1) StartRound() end end
|
|
|
| Report Abuse |
|
|