Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How do I get inside the model?

Asked by 9 years ago
local seats = game.Workspace.Car.VehicleSeat.Anchored -- local variable


function una() -- functiong una means unanchor
    print("I am going to unanchor the seats now.") -- prints
    for _, object in pairs(game.Workspace:GetChildren()) do -- gets all objects in workspace
        print(object.Name) -- prints the objects name
        if object.Name == "Car" then -- sees if there is a car in workspace
            object:GetChildren() -- gets children of the car PROBLEM STARTS HERE
            if object.Name == "VehicleSeat" then -- finds vehicleseat inside the car
                object.Anchored = false -- unanchors the seat PROBLEM ENDS HERE
            end -- ends
            end -- ends
        end -- ends
una() -- runs function
end -- ends

Answer this question