So I made this function which works but it does not work in the while loop which is in the if then statement. I checked in the output if "1" was printed and it was, but the function did not run.
function StartJumping()
game.Players.PlayerAdded:connect(function(Players)
Players.CharacterAdded:connect(function(Char)
while true do
Char:FindFirstChild("Humanoid").Jump = true
Char:FindFirstChild("Humanoid").Sit = true
wait(.1)
end
end)
end)
end
Time = 20
while true do
Time = Time - 1
print(Time)
wait(1)
if Time == 1 then
StartJumping() --HELP HERE
end
end

2 comments
You're running PlayerAdded after a Player is already added, so that Player won't be affected.
How do I fix this problem then?