How do i make converting system(bricks to money)

Lol this is again me with other problem e.

  1. What do you want to achieve? Keep it simple and clear!
    I wanna if u trigger proximity prompt u convert your bricks to money. (1 brick to 0.1 money)

  2. What is the issue? Include screenshots / videos if possible!
    My convert system just don’t work and i don’t know how i convert like 10 brick in 1 money. Here is screenshot:
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Jk i was looking on youtube/devhub, but i didn’t found easy one

Here is script of convert:

local Proximity = script.Parent
local MoneyValue = workspace.Factory.PlayerMoney
local BrickValue = workspace.Factory.PlayerBricks
Proximity.Triggered:Connect(function()
		MoneyValue.Value = BrickValue.Value
		BrickValue.Value = 0
end)

I will be very happy, if you will help me with that

1 Like

i think you need it to be

moneyvalue.value = moneyvalue.value + brick value

The conversion is like any other simple conversion in math.
If 1 brick is 0.1 money then
1.Get the number of bricks the player has.
2.Multiply the number of bricks with the price of each brick.
eg , 1 brick is 0.1 then price of 10 bricks = 10 * 0.1
3.Add the money to the player’s inv(I mean wherever you are storing the money of the player)

Uhm, this is a bit hard for me to understood how to make that

Ah nevermind i understood how to do that

I will just convert bricks to money and divide on ten

I don’t really like providing people with scripts but here you go
(Instead of just skimming try understanding it)

local Proximity = script.Parent
local MoneyValue = workspace.Factory.PlayerMoney
local BrickValue = workspace.Factory.PlayerBricks
Proximity.Triggered:Connect(function()
		MoneyValue.Value = BrickValue.Value * 0.1
print(MoneyValue.Value) --> just to check 
end)

[/quote]

Oh yeah, but first i need to change intvalue to NumberValue

Hmm, this didn’t help, it still no works, hmm

There is even nothing in output, that’s odd.

What are you trying to display on the UI ?
After Prox. is triggered do you want it so that the bricks change to 0 and the ui displays the money?

I already have this system, but value is still 0

Do you have it so that after the value of the money is changed the ui gets updated?

can you show me how the value is stored?

Yes, just like with brick system, here if u need

local MoneyLabel = script.Parent
local Value = workspace.Factory.PlayerMoney

Value.Changed:Connect(function()
   MoneyLabel.Text = Value.Value
end)

Okay.Money:
image
Bricks:
image

Can you provide a picture of the explorer in studio ?

I mean After i trigger Proximity, my money value still 0

What i supposed to open in explorer??

is the factory inside the player? or is it a model