Hey, I’m creating a line game, and I’m having an issue with my client move handler.
if PlayerIndex > NewIndex then
for i = PlayerIndex, NewIndex, -1 do
print(i)
if i == 0 then continue end
local Pad = Numbers:FindFirstChild(i)
Humanoid:MoveTo(Pad.Position)
Humanoid.MoveToFinished:Wait()
end
else
print("plr index is not greater than new index")
print(NewIndex)
print(PlayerIndex)
for i = PlayerIndex, NewIndex, 1 do
print(i)
if i == 0 then continue end
local Pad = Numbers:FindFirstChild(i)
Humanoid:MoveTo(Pad.Position)
Humanoid.MoveToFinished:Wait()
print("Move to finished.")
end
end
NewIndex prints: 2
PlayerIndex prints: 1
“plr index is not greater than new index” also prints
Theoretically, since playerIndex is 1, and NewIndex is 2, the print(I) line should print 1 and 2, correct?
Error: it only prints 1, not 2.