I'm somewhat of a noob and only recently did I learn about GUIs and buttons.
How can I add an in-game store in my game, in which things can be purchased with the in-game money I'm adding into the game?
Hello!
In order to be able to add an in-game store you need to have an ingame currency (e.g leaderstats currency), with that you also need to be able to have a button in which contains a script that subtracts the amount of ingame currency you would like your item to cost and that once the currency amount is subtracted a way for the script to reward the player (e.g rewarding the player a sword tool from ReplicatedStorage) as a LocalScript.
Here is a quick example following what I have stated above:
local Player = game.Players.LocalPlayer local ReplicatedStorage = game:GetService("ReplicatedStorage") local SwordTool = ReplicatedStorage :WaitForChild("ClassicSword") local Backpack = Player:WaitForChild("Backpack") script.Parent.MouseButton1Click:Connect(function() if Player.leaderstats.Cash.Value >= 50 then -- Change 50 to the amount of cash a player required to have in order to be able to buy this SwordTool:Clone().Parent = Backpack Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value - 50 end end)