I want to detect when a player is holding one of the items within a few different conditional buttons. Is it possible to group them together and call IsHoldingItem for all of them, or do I need to list them all separately?
You could store reference to each button in an array and iterate through it whenever you need to make that check.
I’m still pretty new to Verse so I’m not really sure how to do that if you could help? I’ve read through a lot of documentation, but I can’t seem to figure it out.
This function here will return true if Agent is holding any items in any of the buttons in array Buttons
@editable Buttons: []conditional_button_device = array{}
IsHoldingAnyItems(Agent: agent): logic =
for(Button: Buttons):
if(Button.IsHoldingItem[Agent] = true):
return true
return false
Oh my god I was working on this super late and forgot to reference the agent when calling the method, and I had no idea what this error meant:
Which led to me spending a TON of time trying to find workarounds, but still dealing with the IsHoldingNormalWeapon method always returning false and having no idea why. So thank you very much for helping me out, and sorry for the late reply, because I should’ve had this done and working yesterday lol.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.