I’m sorry I’m slow on the uptake, I just like to understand how things work. Two of the components in the code are triggering players team number, and the other is triggering player’s score.
In my game the score is not based on the item being stolen, so the score seems obsolete with that in mind. And the team number also seems like it could screw up the code. Wouldn’t that mean that team 18 will always end up stealing more than team 3 because the value of their team number is larger?
No, because this example was coded wrong. Get score of team should be directly connected to triggering players team number, and THAT should be added to amount of bait.
(That is just overlap from my scrren not being big enough for one screenshot)
No, variables are only for one block. Properties are for every block. What you can do is set a variable to a property, make it act as a property, and set the property equal to a variable.
@mysz I think I did what you said here in the picture below. I used the inventory manager blocks. To me this seems like circular logic where no real values are being exchanged. Look at the Team 3 code in particular. They are both trying to derive value from each other, when neither has any value.
That’s why it would be nice if I could reuse variable from other devices.
The bottom button is the one that gives you the blue fish to test, nothing important there.
The middle one is used to store the bluefish, this is the code
Seems to work for me, the storedfish property is global, the amount of fish is player dependent, not sure if this is what you were looking for though. Tell me if this is what you were looking for!
What doesn’t work about it? I’m guessing (as WhoAmI did) that it could have something to do with the player’s score, because everything else seems fine - if the player’s score keeps track of all the fish that the player has ever gotten, then the amount stored in the property could be increased far more than it should be. There could also be problems with the scale of the property’s change being something other than global, but I’m assuming you already checked that… I can try and make a system like this to test it, but there are probably going to be some limitations that I can’t find a way around.
I started the game with 5 blue fish. Score= 5. Then I pressed the bottom button, losing all my fish and setting my score to 0. Then I click the top button. Nothing.
Yeah, I just tested it out with 4 players and could not get it to function like I wanted it to.
@Zypheir
Just for clarity sake, in my game you purchase blue fish that you then trade in to get GimFish. The leaderboard and game score is predicated on who has the most Gimfish.
I don’t want people to be able to steal GimFish because that would be too OP.
I want people (up to 20) to be able to steal BlueFish.
I have no coding background at all. My only experience with all of this comes from the release of Gimkit Creative a month ago, but logically to me I need properties that keeps track of how many total bluefish each person has.
Then players can go into a different player’s home, click a button/trigger and steal the amount of BlueFish that player has.
I feel like I have more success with using properties when I attach them to counters.
The block used in the first button (for storing the player’s fish):
The block used in the second button (for stealing all fish currently stored):
The main problem with a system like this is that anyone is able to steal fish at any time, regardless of what team they’re on or what team they want to steal fish from - there are only two properties used for all teams, so the fish storage shown here is universally shared between all teams. You can use more specifically named properties (team1_storedfish, for example) to make storage systems for each team, but in order to restrict storing/stealing privileges (like only allowing team 1 to store fish at their storage button) you’ll want to use wire repeaters as well. Hope this helps :]
It would be more complex, but you might want to try to use the interest guide to press a button to take away fish from someone else, and then store it in a property. You can retrieve the stored fish in your place, but other people can take the stored fish from you. That’s a thought