1 | local Button = script.Parent |
2 | local Player = game:GetService( "Players" ).LocalPlayer |
4 | Button.MouseButton 1 Click:Connect( function () |
5 | if Player.leaderstats.Blocks.Value > = 75 then |
6 | Player.leaderstats.Blocks.Value - = 75 |
This code uses the MouseButton1Click
event, which is triggered when a button is clicked. After you click it checks if you at least have 75 blocks, if so, it takes away 75 blocks from the player.
However, this is a really basic script. If you require future assistance, I recommend you check out some Roblox tutorials to gain familiarity with the subject.