I created an auctioning system for my game “Terenergy”, I’ll explain how it works, and maybe you can apply elements of it or all of it to your game:
First, the ui
I have three main elements:
1 - Invisible “parent” frame
2 - Player bid display frame sample
3 - Actual bid button to bid 5 “bidding points”
(Later on I added two more buttons, a (+) and (-) button to allow the player to change how much they bid it’s not necessary, but if you want me to go into it tell me)
When I want to show the auction, the game clears all children of the parent frame and then puts one “player bid display” frame inside the parent frame for every player.
The “player bid display” for a player shows the name, avatar, and the player’s “AmountBidOnBoost” aka the amount that player is bidding. (And it updates when a player changes their bid amount)
Don’t forget to put a UiGridLayout inside the “invisible parent frame” so it spaces out all the player bid frames, or if you want like I did you can animate manually by making the “player bid displays” space themselves out whenever a new one is introduced.
Then there’s the bidbutton which just fires a remote event telling the game that the player is trying to add 5 to their bid.
Now, you can do this a different way, but I made it so that when the player bids, their amount of “Bidding Points” decreases and another value “AmountBidOnBoost” Goes up and this tracks how much the player has bid.
Now, there’s the logic to see who won:
After the time runs out, the player with the top bid gets the boost/reward. If there’s multiple top winners, as of right now I made it so that no one wins. But I’m going to get to changing that sometime in the future.
After the winner is handled, the people who didn’t win get their “Bidding Points” incremeanted by their “AmountBidOnBoost” (aka their bid gets returned to them) then their “AmountBidOnBoost” goes back down to 0.
For the winner, their “AmountBidOnBoost” gets set down to 0 and their biddingpoints do not increase.
This is pretty long so tell me if there’s anything you would like me to add more detail onto.