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

BindActionToInputType, invokeCallBack failed?

Asked by 10 years ago

So I've made a little piece of code to toggle between equipping and unequipping a sword. it's in a local script, and anything mentioned is already defined.

01local swordReady = true
02local swordOn = false
03function ToggleEquipSword()
04    if not swordReady then return end
05    swordReady = false
06    if not swordOn then
07        print('Equip sword')
08        swordOn = true
09    else
10        print('Unequip sword')
11        swordOn = false
12    end
13    wait(1/10)
14    swordReady = true
15end
16 
17contextAction:BindActionToInputTypes('ToggleEquip',ToggleEquipSword,false,Enum.KeyCode.One)

So, things work fine. The output still has prints when I press 1 on my keyboard. However, it also says:

  • ContextActionService::InvokeCallback failed because Callbacks cannot yield

I don't know what this means and I don't know if it will interfere with later parts of the script.

Answer this question