Issue with weapon skins in my game

Hey, I am currently working on a game with a weapon system and I am trying to make a skin system, the idea is that there is a area in witch you enter the ID of the skin (1-10) and it apply’s it to your weapon. My current system with choosing a ID from a table does not work and gets the error " bad argument #3 to ‘TextureID’ (string expected, got nil)"


I would like help on fixing this issue, Thanks. (the only important areas are the top table and bottom function)

1 Like

How high is the number you’re picking that’s giving you that error… You only have 4 entries in that table but you said there’s up to 10.

I mean there will be 10, its just out of 4 right now.

Well, if you draw a number bigger than 4, it doesn’t exist.

you can pick any value so maybe that’s the issue? I just need to know how I can fix the error.

yes but you can type in any value, so you could type in banana. I’m just asking how I can fix it.

1 Like

You bake 6 more different cookies.

You need the 6 other skins, add temporary ids but atleast add something.

yes but you can type in any value, so you could type in banana. It is through a textbox where the player enters a value, when I test the value 1 and try to change the skin I get the error, im asking how can I fix the error and make the table work.

Is the ID argument a number? - If it’s a string it’ll come out as nil.

plr.Character:FindFirstChild(Name).Handle.TextureID = Skins[tonumber(ID)]

Thank you so much! This really helps.

1 Like