Just wanting to know how I can make a tycoon button or circle to build the item its meant to build and how to get it to read the amount of money needed to be spent on that build.
You can detect the player's money value, if it's higher than the requirement, set the money value to money value minus the price.
Heres an example. You must use LocalScript for this! Make sure you put the script in StarterGui.
script.Parent = game:GetService("StarterGui") -- For safety purposes, I set it to you local button = game.Workspace.Button1 local requirementmoney = 100 button.Touched:Connect(function() if game:GetService("Players").LocalPlayer:WaitForChild("leaderstats").Money.Value > requirementmoney - 1 then game:GetService("Players").LocalPlayer:WaitForChild("leaderstats").Money.Value = game:GetService("Players").LocalPlayer:WaitForChild("leaderstats").Money.Value - requirementmoney button:Destroy() else print("Not enough money! ".. requirementmoney - game:GetService("Players").LocalPlayer:WaitForChild("leaderstats").Money.Value .." money is needed to purchase." end end)
This is just an example, the Instances and Values' locations are needed to set on your own.
NOTE: Not all LocalScript will work in workspace.
Closed as Not Constructive by Shounak123 and DeceptiveCaster
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?