The one problem is if the person pushing the button to run the command isn't on the team, then it will still give the closest player who is on that team the money. I need it so that it only runs on the person pushing the button if and only if they are on that team.
A better, but a lot harder way is to use an "item_used_on_block" advancement with a certain block condition (for the button), and for the entity condition as just the player (with no defined item, but has a defined team), to automatically give them that advancement when they press the button, for which their reward would be a function that gives them the cash.
Execute if player on team not working?
So i put this command into an impulse command block: execute as @p if entity @s[team=member] run scoreboard players add @s cash 350
Im pretty sure the mistake is in the (if @s[team=member]) but I'm not sure what it is. Any help would be appreciated thank you
You're running this on the nearest player, so if that player isnt on the member team, then the command will fail.
Try:
You can even just write :
I like trains... OF CHAIN COMMAND BLOCKS !
The one problem is if the person pushing the button to run the command isn't on the team, then it will still give the closest player who is on that team the money. I need it so that it only runs on the person pushing the button if and only if they are on that team.
Oh well, in that case, you can write :
I like trains... OF CHAIN COMMAND BLOCKS !
but then it will just give 350 cash to the closest person who is on that team, not necessarily the person who pushed the button
Sorry, I misread your message ^^'
You can't do that, you have to use another method.
One I can advise is to send a message to the closest player when someone click on the button, and in the message, put :
"Confirm clicking on button : Confirm", and on confirm, put a command
I like trains... OF CHAIN COMMAND BLOCKS !
wow