domogomo
|
  |
| Joined: 03 Jun 2012 |
| Total Posts: 335 |
|
|
| 23 Oct 2014 09:13 AM |
So im doing a script just to practice and I came up to this error. What the script does is instead of finding Part it just goes right to the else. The script:
wait(2)
local Count = 0
function Counting() while wait() do for i,v in pairs (game.Workspace:GetChildren()) do if v.Name == Part then print("Got Part") Count = Count + 1 else print("Not found "..v.Name.." Was found") --It prints this part end end end
print("CheckPoint") while wait() do if Count <= 1 then Workspace.Part:Destroy() end end end Counting()
|
|
|
| Report Abuse |
|
|
domogomo
|
  |
| Joined: 03 Jun 2012 |
| Total Posts: 335 |
|
|
| 23 Oct 2014 09:14 AM |
| I messed up in the bottom part but that does not effect it |
|
|
| Report Abuse |
|
|
domogomo
|
  |
| Joined: 03 Jun 2012 |
| Total Posts: 335 |
|
| |
|
|
| 23 Oct 2014 09:40 AM |
| Part isn't a string dat's why dud |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 23 Oct 2014 09:47 AM |
It would never reach Counting, since you got a while loop which is always true. 1: use a coroutine. 2: name is a string 3: you need to call the function again if its a model
~Master bug finder~ |
|
|
| Report Abuse |
|
|