Some things in workspace dont have a value and when im looping through it errors is there any way to fix this?
for i,v in pairs(game.Workspace:GetChildren()) do local Value = v.Value -- Some things in workspace dont have a value and it gets stuck there and errors print(Value.Value) end
You can use :IsA to whitelist the classes you want, including values.
You can add this to your script to only include Values you want, for example:
for i,v in pairs(game.Workspace:GetChildren()) do if v:IsA("ObjectValue") or v:IsA("BoolValue") then local Value = v.Value print(Value) end end
Prints only the values of ObjectValue and BoolValue.
Also, if you don't want these values to print nil if they're nil, you can add an extra if v.Value ~= nil
under the first if.