Hello, I Really Need Help In This And I'm A Beginner Is Coding So Could You Please Help Me With This Script??
1 | local tool = script.Parent |
2 | local player = script.Parent.Parent.Parent |
3 |
4 | tool.Activated:Connect( function () |
5 | player.leaderstats.Technology.Value = player.leaderstats.Technology.Value + 1 |
6 | end ) |
There is something called debounce.
01 | local tool = script.Parent |
02 | local player = script.Parent.Parent.Parent |
03 | local debounce = false |
04 | tool.Activated:Connect( function () |
05 | if debounce then |
06 | debounce = true |
07 | player.leaderstats.Technology.Value = player.leaderstats.Technology.Value + 1 |
08 | end |
09 | wait( 2.5 ) |
10 | debounce = false |
11 | end ) |
My Leaderstats is
01 | function createLeaderstats(plr) |
02 | local leaderstats = Instance.new( "StringValue" ) |
03 | leaderstats.Name = "leaderstats" |
04 | leaderstats.Parent = plr |
05 |
06 | local technology = Instance.new( "IntValue" ) |
07 | technology.Parent = leaderstats |
08 | technology.Name = "Technology" |
09 | technology.Value = 0 |
10 |
11 | local coins = Instance.new( "IntValue" ) |
12 | coins.Parent = leaderstats |
13 | coins.Name = "Coins" |
14 | coins.Value = 0 |
15 |
Closed as Not Constructive by User#6546
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?