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

Why is string.find() returning nil without any errors everytime? [closed]

Asked by 5 years ago

I've been trying to fix this part that checks if there is a word then return with true or false with string.find() in a function, here is the part of the script:

        local function find1(word)
            local f2c = frame2:GetChildren()
            for i = 1,#f2c do 
                local c = f2c[i]
                return string.find(c.Text,word)
            end
        end
        local function find2(word)
            local f2c = frame2:GetChildren()
            for i = 1,#f2c do 
                local c = f2c[i]
                return string.find(c.Text,word)
            end
        end

        if find1(tostring(amount)) == nil and find2(stat) == nil then

It always returns nil even tho there is the texts in the "c.Text" part.

If anyone could help me and describe what i did wrong here then i would be thankful!

0
Try getting debug information yourself and tell us what you put in the text boxes before posting. hiimgoodpack 2009 — 5y
0
how do i do that? SamirDevs 15 — 5y

Closed as Non-Descriptive by hiimgoodpack and WideSteal321

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?