Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make your currency spendable?

Asked by
Tizzel40 243 Moderation Voter
6 years ago

like how do you make a shop to spend your currency on like i want to make a shop gui and when i press purchase i have the item.

0
Where the code you did? I dont even know if its FE Sergiomontani10 236 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

localscript

local cash = game.Players.leaderstats.Cash
local gui  --script.Parent??
local item -- item...
local amount = 100
gui.MouseButton1Click:Connect(function()
    if cash.Value >= amount then
        item:Clone().Parent = game.Players.LocalPlayer.BackPack
        cash.Value = cash.Value - amount
    end
end)

The only reason why this will not work is because gui is not defined, gui is meant to be the button and the cash is not defined "Properly" Amount is the amount you need to buy the object the script may not work depending on the item, you code the item part, I don't know your explorer

Won't work with filter enabled

Ad

Answer this question