I have to check if in the start there is a [RARE], [EPIC] or [LEGENDARY]
How to?
I tried this with some part of scripts i found here:
cut/get a part of string lua (item name script)
How to?
I tried this with some part of scripts i found here:
Code:
function getRarity(str)
print("starts getRarity")
local value = 0
local n = str:match("%[(.-)%]")
print("rarity:")
print(n)
if n == "RARE" then
value = 1
elseif n == "EPIC" then
value = 2
elseif n == "LEGENDARY" then
value = 3
end
print("value:")
print(value)
print("ends getRarity")...