for i = 3, 0, -1 do wait(1) if i == 3 then timeleft.Image = "rbxgameasset://Images/Respawn3" elseif i == 2 then timeleft.Image = "rbxgameasset://Images/Respawn2" elseif i == 1 then timeleft.Image = "rbxgameasset://Images/Respawn1" elseif i == 0 then timeleft.Image = "rbxgameasset://Images/RespawnNow" end end
This whole script works and all, but I was just wondering is their an easier way to do this instead of constantly checking to see what i equals to?
All I did was have a concatenation of the i value to the first three images. Then I moved the RespawnNow out of the for loop since the for loop terminates when it's done. Basically saying I just have the script automatically add the number to the end of the first three links, and then have the image change to RespawnNow when the for loop is done.
for i=3, 1, -1 do timeleft.Image = "rbxgameasset://Images/Respawn" .. tostring(i) wait(1) end timeleft.Image = "rbxgameasset://Images/RespawnNow"