Hello, thanks for reading. I am facing a complex problem (for me), because I have no understanding of how to make this, and I require a script from someone else for this, or I simply cannot make this. It sounds easy though.
My idea: I am making a game with hammers (what we need to know for this issue) and smashpoints (currency) You start our for a lvl1 hammer upgradable by 1 upwards to lvl 3. I have a gui with an upgrade button. If you press it, it takes an amount of currency from you, and upgrades a stat in the player by 1. (200 coins for lvl2 600 coins for lvl3)
I don’t know if I explained it correctly, but I need someone to make me a script that runs when a button is pressed (make it anything you want, I can edit it) and it contains a code that checks if the player has the required amount of coins to upgrade, and if they do, it removes the coins and adds +1 to plr.HammerLevel
Roblox has stated here on the DevForum that you cannot ask people to write an entire script for you.
Though, I will show you what you can try.
If plr.hammerLevel is in the players leaderstats, Then you could do something like
For the button (i think you know how to detect when its pressed)
if plr.leaderstats.SmashPoints.Value >= --insert needed value) then
plr.leaderstats.HammerLevel.Value = plr.leaderstats.HammerLevel.Value + 1
plr.leaderstats.SmashPoints.Value = plr.leaderstats.SmashPoints.Value - -- the number you want to take away
end
As i stated, I cannot create a full script for you, But this is basically all i can do.
If this doesnt work, Try searching it up
This video could help
Or try searching it up somewhere else, Maybe even here on the dev forum.