PHP add functions into a existing code

Job ID: 38478696

Budget: $250 – $750 USD

I need help to create a mini game into a Chatroom System website (they have Group Chat & One to One Chat ). I got this script from 3rd party (https://grupopro.baevox.com/) (https://codecanyon.net/item/grupo-pro-chat-room-script/25263116), it is not using laravel or any open source system, so you will require to understand their scripts.

Mini game like lucky draw (virtual red packets):
Any user can create lucky draw pool and send their money into a group chat, and when other users in the group chat clicked on the pool's icon/button, they can get a certain amount of money from the pool. For example, User A with 100 game coin, can create a lucky draw pool and put in 100 game coin (any amount User A want, he can just put 50 game coin too) into the groupchat. If the groupchat have 10 people, then the 10 people can start clicking the pool's button (each person can only click once), then they will get a random amount of game coin from 0 - 50% of the money. So User B might get 0 game coin, User C might get 50 game coin, and User D get 8 coin.... until 100 coin is given out. If there are users that didnt clicks, meaning there will be balance in the pool, after 1 hour, the balance coin will return back to User A.

Things that need to add:
1) mini game
2) wallet to receive or give coin
3) coin record logs

to understand more about this game, you can google red packet game in google.
Related categories: PHP MySQL HTML5