Results 1 to 3 of 3

Thread: Call a global function from a local script

  1. #1

    Call a global function from a local script


    is it possible to call a global function from a local script? I want to create a lot of buttons for each figurine object on my table.
    Each button does the same for its parent figurine (at the position of the figurine), so that i dont want to copy and paste the function many times in a local script.

    [Button] -> [Local] (function localButtonAction(){ globalButtonAction(this) }) -> [global] (function globalButtonAction(obj) { //... } )

    maybe there is a better way to solve this?


  2. #2
    Join Date
    May 2016
    I haven't tried it, but did you try, tableOfParameters)?

  3. #3
    Hi, thx for your replay. That worked well!

    Global:call(...) is the right Syntax.

    for the sake of completeness:


    create Buttons for each Figurine, Figurine is button_owner


    localAction calls Global:call("buttonAction", {self})

Posting Permissions

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