Hi, just a quick one.
I have this code:
local configuration = game.Workspace:FindFirstChild('configuration') -- folder local currentFoot = configuration:FindFirstChild('currentFoot').Value -- string value currentFoot = "Right Leg"
However, the value isn't setting and I am not sure why.
Maybe useful to note that this is in a localscript. Any help is appreciated.
You can really only use variables to get objects and such, not values.
local currentFoot = configuration:FindFirsChild('currentFoot') currentFoot.Value = 'Right Leg'
Thank you, I have tried this and changed the code to the following:
repeat wait() until game:IsLoaded() local configuration = game.Players.LocalPlayer.Backpack:WaitForChild('configuration') local currentFoot = configuration:WaitForChild('currentFoot') currentFoot.Value = "Right Leg" print(currentFoot) -- will print "nil" print(currentFoot.Value) -- will error "attempt to index value with nil"
To me it doesn't make any sense because the variables are set correctly and I've added WaitForChild to the objects to be sure. Then I have also added the first line to make sure the game is loaded.