Money Transfer System

Hey,
im making a RP game and i want ppl to transfer ingame money with a gui.
i would like to know how to make that.

2 Likes

If you’ve already set up a system where money and data is stored and can be obtained, you can make a gui where they give x amount of money that they can give and get the values of how much to give to each player from TextBoxes.

But im a beginner scripter so i want to get some instructions

Preparation:

  1. Make a leaderstats with Money currency.
  2. Make a GUI for transfering Money.
  3. Make a two TextBox inside a GUI which is for Name and Value.

Start with Code:

  1. Detect FocusLost of TextBox script.Parent.FocusLost:Connect(function() FocusLost

  2. Detect if FocusLost equal player name then the player who transfers the money will decrease according to the amount of money that is entered, and the player who transfers the money will increase according to the amount of money that is entered into the TextBox

Some of the ways that I gave above may not make sense and will not be complete, if you try it will not work, but the method above is the steps to make it

3 Likes

Okay, so you already have a GUI set up right?

If you don’t you should first set up a gui that has two sides for each player, they should both have a TextLabel to represent how much they’ll give. I think @ryanhawari17 is writing a script to get you started now on how the setup could be, all I know though is that you need to get two of the Players IntValues that are in a trade.

Then you’ll need to make a remote so that it’ll send the money that’s being given and taken from both players, which you make a Server Sided Script to listen for the fire of that remote and most of the code will be done there.

1 Like

@boy_gamer20044 let me know when you need more assistance on this

You can just make a transfer button instead of adding a focus lost button so that the player doesn’t accidentally transfer the money from someone else

Well yeah you can do that too by making player name inside a button

Wouldn’t it also work if it was used with a RemoteEvent?

Like lets say Player1 had finish with their transaction, so when they click on ready it’ll set the values within either the button or a folder. Same goes with Player2, which if they’re both ready it’ll send the values with a remote event.