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:

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

Answer this question