Quantcast
Channel: OTLand
Viewing all articles
Browse latest Browse all 32082

cut/get a part of string lua (item name script)

$
0
0
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:
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")...
cut/get a part of string lua (item name script)

Viewing all articles
Browse latest Browse all 32082

Trending Articles