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

how do I make it so I can buy stuff in my game with in game money?

Asked by 4 years ago

Here is the script I used to add money to my game. I want it so that if you buy something you get a tool.

local id = 1172399 


game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder",player)
    leaderstats.Name = "leaderstats"

    local Cash = Instance.new("StringValue",leaderstats)
    Cash.Name = "Cash"

    local doesOwn
    local success, message = pcall(function()
        doesOwn = game.MarketplaceService:UserOwnsGamePassAsync(player.UserId,id)
    end)
    if doesOwn then
        Cash.Value = "Infinite"
        print(player.Name.." owns the gamepass")
        game.ReplicatedStorage.Notifications:FireClient(player,"You own the infinite money gamepass!")
    else
        print(player.Name.." does not own the gamepass")
        game.ReplicatedStorage.Notifications:FireClient(player,"You do not own the infinite money gamepass.")
        Cash.Value = 0
        while wait() do
            wait(10)
            Cash.Value = Cash.Value + 25
        end
    end
end)
0
Have you ever tried making a script or do you just rely on other people to spoonfeed you Uzixt 19 — 4y
0
You know you could just -Cash.Value when they press a button to buy smt and just clone tool from server storage EpicLLBro 11 — 4y
0
I am only here to give idea on how to. Maybe next time, try it yourself through trial and error. EpicLLBro 11 — 4y
0
the only part i need is the part to give a tool rainbowslime242 12 — 4y
View all comments (2 more)
0
Hi rainbow, i am working on a script for you that will work! Piloten2008YT1 34 — 4y
0
ok thanks! rainbowslime242 12 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Hi, I could not manage to make a script, But all you need to do is make a clone of the item, and put it in the players

"Backpack" and "StarterGear"

Ad

Answer this question