Advertisement
qsenko1

Multiple Gif change Script!!!

Mar 7th, 2021
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.93 KB | None | 0 0
  1. local Frames = 25 --The amout of frames
  2. local currentFrame = 1
  3. local rows = 5
  4. local columns = 5
  5. local currentRow,CurrentColumn = 0,0
  6. local linear = false
  7. local fps = 30
  8. local full60fps = false
  9. local size = script.Parent.Parent.Size
  10.  
  11. local Texture1 = script.Parent
  12.  
  13. Texture1.Texture = "rbxassetid://6485331167"
  14. Texture1.StudsPerTileU = columns*size.X
  15. Texture1.StudsPerTileV = rows*size.Y
  16.  
  17. while true do          
  18.     if not full60fps then wait(1/fps) else game:GetService("RunService").Stopped:Wait() end
  19.     if linear then
  20.         Texture1.OffsetStudsU = Texture1.OffsetStudsU + size.X
  21.         if Texture1.OffsetStudsU > Texture1.StudsPerTileU then
  22.             Texture1.OffsetStudsU = 0
  23.         end
  24.     else
  25.         CurrentColumn = CurrentColumn + 1
  26.         if CurrentColumn > columns then
  27.             CurrentColumn = 1
  28.             currentRow = currentRow + 1
  29.         end
  30.         if currentFrame > Frames then          
  31.             if currentFrame > Frames and Texture1.Texture == "rbxassetid://6485331167" then    
  32.                 wait(0.1)
  33.                 Texture1.Texture = "rbxassetid://6489512459"           
  34.                 print("it was first id")
  35.                 currentRow,CurrentColumn,currentFrame = 1,1,1
  36.             end    
  37.             if currentFrame > Frames and Texture1.Texture == "rbxassetid://6489512459" then                    
  38.                 if currentFrame > Frames then
  39.                     wait(0.1)
  40.                     Texture1.Texture = "rbxassetid://6485591896"               
  41.                     print("It was second id")
  42.                 currentRow,CurrentColumn,currentFrame = 1,1,1
  43.             end
  44.         end            
  45.             if currentFrame > Frames and Texture1.Texture == "rbxassetid://6485591896" then                    
  46.                 if currentFrame > Frames then
  47.                     wait(0.1)
  48.                     Texture1.Texture = "rbxassetid://6485331167"               
  49.                     print("It was third id")
  50.                     currentRow,CurrentColumn,currentFrame = 1,1,1
  51.                 end
  52.             end                
  53.             print("Frames:",Frames,"currentFrame:",currentFrame,"currentRow:",currentRow,"CurrentColumn:",CurrentColumn)           
  54.         end
  55.         Texture1.OffsetStudsU = size.X*(CurrentColumn-1)
  56.         Texture1.OffsetStudsV = size.Y*(currentRow-1)
  57.         currentFrame = currentFrame + 1        
  58.     end
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement