On a particular Roblox place save, all the scripts I make simply won't detect instances. There is no determining which instances it will see, and which ones it won't, I haven't found any correlations or patterns. It's completely random. It started when I was trying to make a simple driving script that needed to access some BoolValues located in the player's character model. I ran this code that will print what the script is able to see:
local children = workspace:GetChildren() for i = 1, #children do child = children[i] print(child) end
And for some reason, the script doesn't print any of the BoolValues that are there. I know they're there, I'm not blind. This doesn't just happen within the player's character model, it happens anywhere. Sometimes it refuses to detect parts in the workspace. I've never encountered this problem before, but I've been trying to figure this out for two days, and I've had no luck. Any idea why this is happening? Is there something I don't know?
Ok, your method isn't the best way to go about this. You should modify your script to this:
for _,v in pairs(game.Workspace:GetChildren()) do print(v.Name) end
What this script will do is cycle through every child in the workspace and set the local value "v" to that instance. Then it'll print the instance's name. If you want to go through everything in the workspace (example: part in model in workspace) you would replace :GetChildren()
with :GetDescendants()
I hope this answers your question.