Hi!
Im having some issues with a script i wrote to set the properties of parts inside a model to some value.
however, the issue im facing is that when i actually get to setting it, it just resets back to it's original state for some reason-
function helper.ModelAppearance(model, appearanceProperty, value)
for _,obj in pairs(model:GetChildren()) do
-- append the appearance property i wanna change to the end of the path
local modified = obj:GetFullName().."."..appearanceProperty
-- convert the string back into an actual object
local target = helper.StringTarget(modified)
-- but for some reason it wont set it???
target = value
end
end
Here's some console output logged after i added print statements to help me debug:
[image 1: setting the model's transparency to 1, invisible]
[image 2: setting the model's transparency to 0, visible]
The console output is a print before and after each variable set (except for target).
"Original" and "Modified" are the before and after of modified
I convert the path to the model into a string and append the appearanceProperty variable to the end
"Target" and "Target Type" print out target's path and type
Here I convert the string back into an object
"Value before" and "Value after" are the before and after of target = value
Here I just set the targeted property to the given value
