Is there a way to limit how many players can be attached to someone? I made a script to let team mates ride Orisa but I want to limit it to one at a time. Is this possible? If so, I can’t seem to figure it out.
Just set a random player variable to the bot orisa, and set it to true when there’s a player riding it, and set it to false when there’s none. Then add a condition to the rule where you ride orisa where that player variable of orisa should be false
Dumb question but how would I make the game check if a player is already attached in order to set the player variable to true/false?
That’s not a dumb question, don’t worry. The player variable already acts like a checker itself, just go to the rule where it lets you ride the orisa, and then add another action where you set that player variable to true, and the target should be the slot of the orisa bot.
Ahhh, I get it now. I had trouble understanding until I started messing around with player variables a bit and now your help makes much more sense. Thank you so much!
You will also need to set the player variable to false if the attached player dies or is too far away from their parent player.
This is because attached players will automatically detach if they die or are attached to a different player via an ability (Reinhardt’s Charge does this).
UPDATE: So this doesn’t exactly work for what I’m doing. What I have set up is a rule to attach a player to Orisa when the player variable is false and the interact key is pressed which changes the variable to true, another rule to detach the player when the jump button is pressed and sets the player variable back to false.
The problem I’m having is that as long as anybody presses the jump button at any time the player variable gets set to false so it still allows as many people as are in the game to attach to the Orisa.
Can anyone tell me what I’m missing?
Try to look at SpaceJester’s suggestion too, it may help with that. But I think the problem might be the target for that player variable, make sure that the player variable should be for the player slot of the bot orisa, (Which can be set through the “Players in slot” Value) not “Event Player”, I often had mistakes like that sometimes so maybe that could be causing the problem. I cant think of anything else that you might be missing or that might be causing the problem 
Also, if you set the variable not to “true/false” but to “event player/null” (event player = the player who is riding in this context), you are saving the information wich player is riding orisa aswell, so you can only allow him to detach himself.
I wasn’t using “Players in slot” and I’m not sure I understand how it works. This clearly isn’t correct but it’s what I’ve been trying:
>variables
{
player:
1: RIDABLE_ORISA
}
actions
{
Players In Slot(Slot Of(Players On Hero(Hero(Orisa), Team Of(Event Player))), Team Of(Null)).RIDABLE_ORISA = True;
}
with “RIDABLE_ORISA” being the player variable. Corrections greatly welcome. (dunno why the code formatting on the forums just stopped working halfway through that)
Oof, don’t use “Players on hero” as it will also detect players who will pick Orisa, unless you deactivated Orisa as a playable hero in your game, When you created the Orisa Bot, there’s a slot value that you can input in the “Create Dummy Bot” action so you could choose which slot it should take. Like for example if you put 0 as the slot for the orisa bot in the “Create Dummy Bot” Action, you should use that as the value for “Players in Slot” for your variable, Also Shanalotte’s suggestion will help too for a more accurate game.
Ah, I forgot to mention that. The thing is I want it to detect players who pick Orisa but I’ve been testing it on a bot. So can I assume the same logic doesn’t apply if it’s a player?
In this case, scrap the idea with “players in slot”. Just use an “ongoing each player” rule and use event player.RIDABLE_ORISA and add the condition hero of(event player) == hero(orisa).
In general, “players on hero” is an action for a very specific usecase, since it returns an array of all the players currently playing orisa.