Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What method returns the Value of a Matched string?

Asked by
Shadrz 40
6 years ago

So basically, I have been looking around for a method/function that can match the string and then return the string it found. Just so I can find it and use it as a variable.

Here's my code:

1for v, k in pairs(items) do
2    print(v, k)
3    for _, i in pairs(case:GetChildren()) do
4        if string.match(i.Name, v) then
5            local Chance = string.gmatch(i.Name, v)
6            chances[v] = case[Chance].Value * 10000
7        end    
8    end
9end
0
gmatch returns an iterator function. User#24403 69 — 6y

Answer this question