Hello. I'm trying to make a script that sits everyone in the server automatically after a bool value is true. I'm just a beginner in Lua yet, I'm having a trouble with that script and I can't figure out what's the problem with my script. I only get "Workspace.Script:6: attempt to index nil with 'Sit'" error when I run the script. Here's the script that I made:
while wait(1) do
if game.Workspace.AllSit.Value==true then
for _,v in pairs(game.Players:GetPlayers()) do
local h = v:findFirstChild("Humanoid")
h.Sit = true
end
end
end
...and the last thing I have to say is I'm running that script in the Workspace, as a normal Script. I would be really happy if you help me about that "easy" script which I can't even run it properly.

2 comments
local h = v.Character.Humanoid v.Character.Humanoid.Sit = true
Thank you so much!