Jump to content

[HELP]How to ignore numbers in value?


Enkanet

Recommended Posts

Hello everyone. I need to show a picture for my item but I need to show the pictures of the item by the value of the item. I have skin items and ids. So, if the skin item's value is 1 so when I use the item I get a skin with the id of 1. I have a folder for them which is called "img" folder. There're skin pictures inside it and they are ordered from "1.png" to "299.png" (example) I want to show that pictures with my item by using the value. I am using that code and it works. "return ":img/" .. ("%03d"):format(itemValue) .. ".png"" but sometimes I have item value like 120:1 so the game tries to find an image with name of 120:1.png but it can't. Now I want to ignore the numbers after ":" this syntax. So if the item's value is 120:1 the game should show me a picture of 120. Sorry if I made mistakes with my English. I am writing this at 4:30AM and I am so sleepy. So forgive me if I made a mistake. Thanks.

Regards.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...