how I can get one part in folder
local FolderPart = game.Workspace.Folder:WaitForChild("Parts")
for _,Part in FolderPart:GetChildren() do
---how i can get one part of the folderpart
end
how I can get one part in folder
local FolderPart = game.Workspace.Folder:WaitForChild("Parts")
for _,Part in FolderPart:GetChildren() do
---how i can get one part of the folderpart
end
You could do:
FolderPart[“name_of_part”]
Not sure if this is what you’re asking for
or, if you want inclusivity / exclusivity to an action, you can also do
if part.Name == "name_of_part" then
--bla bla bla
end
I’m trying to take one part form Folder because I don’t want write names of parts one by one
You can just do FolderPart:GetChildren()[1]
.
If you can’t identify by name, what are you trying to identify by? Colour? Size? CFrame? Position? What are you even trying to do?
give me an erro code
ServerScriptService.GameScript.Teams.TeamHandle:17: attempt to iterate over a Instance value
i need wen the player joine game get one part and rename to has name
You don’t have to iterate through it, just replace the loop with what I sent to you, that should only return one random part from the folder you specified. Not sure what you’re exactly trying to achieve tho.
done i make new way
local PlayerRoom = game.Workspace:WaitForChild("Folder"):WaitForChild("PlayerRoom"):GetChildren()
while wait( 5) do
local RanodmNumbers = math.random(1, # PlayerRoom)
local Room = PlayerRoom[RanodmNumbers]
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.