Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Frames = 25 --The amout of frames
- local currentFrame = 1
- local rows = 5
- local columns = 5
- local currentRow,CurrentColumn = 0,0
- local linear = false
- local fps = 30
- local full60fps = false
- local size = script.Parent.Parent.Size
- local Texture1 = script.Parent
- Texture1.Texture = "rbxassetid://6485331167"
- Texture1.StudsPerTileU = columns*size.X
- Texture1.StudsPerTileV = rows*size.Y
- while true do
- if not full60fps then wait(1/fps) else game:GetService("RunService").Stopped:Wait() end
- if linear then
- Texture1.OffsetStudsU = Texture1.OffsetStudsU + size.X
- if Texture1.OffsetStudsU > Texture1.StudsPerTileU then
- Texture1.OffsetStudsU = 0
- end
- else
- CurrentColumn = CurrentColumn + 1
- if CurrentColumn > columns then
- CurrentColumn = 1
- currentRow = currentRow + 1
- end
- if currentFrame > Frames then
- if currentFrame > Frames and Texture1.Texture == "rbxassetid://6485331167" then
- wait(0.1)
- Texture1.Texture = "rbxassetid://6489512459"
- print("it was first id")
- currentRow,CurrentColumn,currentFrame = 1,1,1
- end
- if currentFrame > Frames and Texture1.Texture == "rbxassetid://6489512459" then
- if currentFrame > Frames then
- wait(0.1)
- Texture1.Texture = "rbxassetid://6485591896"
- print("It was second id")
- currentRow,CurrentColumn,currentFrame = 1,1,1
- end
- end
- if currentFrame > Frames and Texture1.Texture == "rbxassetid://6485591896" then
- if currentFrame > Frames then
- wait(0.1)
- Texture1.Texture = "rbxassetid://6485331167"
- print("It was third id")
- currentRow,CurrentColumn,currentFrame = 1,1,1
- end
- end
- print("Frames:",Frames,"currentFrame:",currentFrame,"currentRow:",currentRow,"CurrentColumn:",CurrentColumn)
- end
- Texture1.OffsetStudsU = size.X*(CurrentColumn-1)
- Texture1.OffsetStudsV = size.Y*(currentRow-1)
- currentFrame = currentFrame + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement