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 » Scripters
Home Search
 

Re: How ?

Previous Thread :: Next Thread 
Creatorworld is online. Creatorworld
Joined: 26 Dec 2013
Total Posts: 492
10 Feb 2017 05:35 PM
How can i detect every part that has a specific name like : " hi "


Report Abuse
Treeecow is not online. Treeecow
Joined: 10 Jun 2011
Total Posts: 5161
10 Feb 2017 05:36 PM
ctrl + f
Report Abuse
Creatorworld is online. Creatorworld
Joined: 26 Dec 2013
Total Posts: 492
10 Feb 2017 05:37 PM
in a script


Report Abuse
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
10 Feb 2017 05:41 PM
for i,v in ############################ ## # = Instance.new("Folder", workspace) if ###### ## "hi" then ######## = game.Workspace.Folder end end
Report Abuse
Creatorworld is online. Creatorworld
Joined: 26 Dec 2013
Total Posts: 492
10 Feb 2017 05:43 PM
try without hashtags pls


Report Abuse
ROBLOXBattleChamp is not online. ROBLOXBattleChamp
Joined: 02 Mar 2010
Total Posts: 176
10 Feb 2017 05:47 PM
function recurse(Model)
local children = Model:GetChildren()
for i = 1,#children do
if children[i]:IsA("Part") and children[i].Name == "hi" then
print("Part found")
elseif children[i]:IsA("Model") then
recurse(children[i])
end
end
end

recurse(Workspace)


1) Cycle through workspace, find all parts with specified name
2) Cycle through models inside workspace, find all parts with specified name
3) Cycle through models inside other models, find all parts with specified name

Hope this helped


Report Abuse
Creatorworld is online. Creatorworld
Joined: 26 Dec 2013
Total Posts: 492
10 Feb 2017 05:59 PM
i dont really understand so i cant really make a command from it


Report Abuse
haskjdfsask is not online. haskjdfsask
Joined: 08 Jun 2014
Total Posts: 810
10 Feb 2017 06:19 PM
depends on where you are looking for it.

here is my script, it will always find the part, but it will look everywhere so it may not be efficient.

ObjectName="hi" --Name of thing we are looking for
ObjectClassName="Part" --Type of thing we are looking for

Directories={--look for the thing in these directories
game.Lighting,
game.Workspace,
game.Players,
game.ReplicatedFirst,
game.ReplicatedStorage,
game.ServerScriptService,
game.ServerStorage,
game.StarterGui,
game.StarterPack,
game.StarterPlayer,
game.Soundscape
}

function Find(ObjectName,ObjectClassName,Directory,Iteration)
local DirectoryName=Directory.Name
local Di################################# local St################################# print(Stylize..'Searching for "'..ObjectName..'" in '..DirectoryName)
for i=1,#Directory do
if Directory[i].ClassName==ObjectClassName and Directory[i].Name==ObjectName then
print(Stylize..'Found "'..ObjectName..'" in "'..DirectoryName..'"')
return(Directory[i])
else
print(Stylize..'"'..ObjectName..'" not found in "'..DirectoryName..'" ('..DirectoryName..'.'..Directory[i].Name..')')
if #Directory[i]:GetChildren()>0 then --has children
print(Stylize..'+Searching for "'..ObjectName..'" in '..DirectoryName..'.'..Directory[i].Name)
Find(ObjectName,ObjectClassName,Directory[i],Iteration+1)
end
end
end
end

for i=1,#Directories do
########################################################## ObjectValue (pointer to found object)
end
Report Abuse
haskjdfsask is not online. haskjdfsask
Joined: 08 Jun 2014
Total Posts: 810
10 Feb 2017 06:20 PM
Welp, it censored (as expected)

here is a link to it in script form (without hash tags)

https://www.roblox.com/catalog/649282189
Report Abuse
haskjdfsask is not online. haskjdfsask
Joined: 08 Jun 2014
Total Posts: 810
10 Feb 2017 06:21 PM
Oops, malformed link. Here is the right one

https://www.roblox.com/catalog/649282189/item
Report Abuse
ROBLOXBattleChamp is not online. ROBLOXBattleChamp
Joined: 02 Mar 2010
Total Posts: 176
10 Feb 2017 06:24 PM
function _G.recurse(Model,string)
local children = Model:GetChildren()
for i = 1,#children do
if children[i]:IsA("Part") and children[i].Name == string then
print("Part found")
elseif children[i]:IsA("Model") then
recurse(children[i])
end
end
end

Put this into any script, now you can call _G.recurse() with your F9 console or from any other script.

"Model" is the model you want to begin searching in.
"string" is the name of the part you are searching for.

_G.recurse(Workspace,"hi") will search Workspace and all models that are children of workspace for any part named "hi"


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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