I have multiple NPC's with the same name in Workspace. They all have a bool value. How do I change the values of the bool value in all of the NPC's when I press a button?
`local Button = script.Parent
local function LeftClick()
local Npc1WS = game.Workspace:GetChildren()
for i,v in pairs(Npc1WS) do
if v:IsA("Model") then
v.Stats.Actions.Halt.Value = true
end
end
end
Button.MouseButton1Click:Connect(LeftClick)`

3 comments
Sorry I messed up with the formatting.
Is there an error? I don't really see anything wrong at the moment.
Yes, it keeps saying "Stats is not a valid member of Model", but stats is a child of model.