Results 1 to 2 of 2

Thread: Does Global:call() work, or does it only work for objects?

  1. #1

    Question Does Global:call() work, or does it only work for objects?

    I can't seem to get it working.

    The Global script sets the button function owner to the checker, then the checker attempts to call a more globalised function.

    Code:
    minutes = 1
    
    function onButtonPress()
        Global:call("setTimerMinute", {minutes})
    end
    Code:
    function setTimerMinute(minutes)
        for i = 1, #timer do
            timer[i].Clock:setValue(60 * minutes)
            timer[i].Clock.paused = true
        end
    end
    Last edited by Mark; 08-08-2016 at 01:50 PM.

  2. #2
    Oops I see what I did wrong, the function will only receive a table function so all I needed to do was this:
    Code:
    function setTimerMinute(params)
        for i = 1, #timer do
            timer[i].Clock:setValue(60 * params[1])
            timer[i].Clock.paused = true
        end
    end
    Sorry for the pointless thread...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •