Forum > General >

How would I change a value of a global variable?

SmittyTitty

JoeDaddy

Posts: 7

Threads: 4

Joined: Sep, 2020

Reputation: 0

Posted

Hello, I am trying to set the value of a global variable which I found using getrenv(); however, the value doesn't seem to change. It is either being updated, or it is my code that is wack:

for i, v in next, getrenv() do

    if i == "_G" then

        for k, x in pairs(v) do

            if k == "Walking" then

                x = true

            end

        end

    end 

end

Is this how you would change the global variable?

Thanks in advance.

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )