generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Cant find "Part" in workspace?

Previous Thread :: Next Thread 
domogomo is not online. 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 is not online. 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 is not online. domogomo
Joined: 03 Jun 2012
Total Posts: 335
23 Oct 2014 09:23 AM
Nvm fixed
Report Abuse
HyroadCoder is not online. HyroadCoder
Joined: 15 Jul 2014
Total Posts: 813
23 Oct 2014 09:40 AM
Part isn't a string dat's why dud
Report Abuse
vlekje513 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image