below is a script with zero errors:
players = game.Players:GetPlayers()
while true do
wait(1)
print("test")
for i,v in pairs(players) do
print("test2")
local character = v.Character or v.CharacterAdded:Wait()
repeat
wait()
until character
local humanoid = character:WaitForChild("Humanoid")
if character:FindFirstChild("thirst").Value <= 20 then
humanoid.Health = humanoid.Health - 40
end
if character:FindFirstChild("hunger").Value <= 20 then
humanoid.WalkSpeed = 5
else
humanoid.WalkSpeed = 12
end
tick()
end
end
no errors? then what is the problem? you may ask, I have no clue... where does it stop? it stops at the part where it says:
for i,v in pairs(players) do
it prints "test" but not "test2"
EDIT: i found out to fix it i had to put :getplayers into the while loop and make it local

2 comments
Maybe try doing players:GetPlayers() in the pairs loop, new to roblox as well...
for i,v in pairs(players) do needs players so if i defined it after that it would not worl