I'm making a gun spritesheet that changes the image based on the ammo.
I have 30 images in a table.
local circular = {"rbxassetid://123123123","rbxassetid://123123124"} --etc etc
I tried this
userInput.InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.E then ammo = ammo - 1 image.Image = circular[ammo] end end)
Then I get this error; 13:25:10.171 - Image "https://assetdelivery.roblox.com/v1/asset?id=73737627" failed to load in "Players.bPanasider.PlayerGui.ScreenGui.ImageLabel.Image": Request failed
I read up on people using RectOffset and stuff but I don't know why I need that stuff, I'm using one imagelabel with a bunch of images that are the exact same dimensions, I just want to get a new one whenever the ammo goes down, eg: there is 30 ammo so it grabs the 30th one from the table, when ammo goes down I'll update the ui and grab the next one which would be 29.
To loop through items in an array (if thats how you're storing the sprite sheet) in order use ipairs()
for i,v in ipairs() do --whatever end