As stated by Dino, you'd have to use a debounce. Basically, this stops a function from running too many times.
To implement it, you need to initialize a boolean value which in your case could be done directly below HoleValue. To avoid confusion we'll just call it debounce.
Now, how do you use a debounce? You will have to use a conditional if statement at the start of your function to check if debounce is equal to false.
01 | script.Parent.Touched:Connect( function (hit) |
04 | if hit.Parent:WaitForChild( "Humanoid" ) then |
05 | local PlayerName = hit.Parent.Name |
06 | local Multiplier = game.Players [ PlayerName ] .leaderstats.Multipliers.Value |
07 | hit.Parent.Humanoid.Health = 0 |
08 | local EsimateValue = HoleValue * Multiplier |
09 | game.Players [ PlayerName ] .leaderstats.Oofs.Value |
10 | game.Players [ PlayerName ] .leaderstats.Oofs.Value + EsimateValue |
The next step is hopefully quite obvious. We need to set the debounce to true when we begin the function and false when it is finished.
02 | script.Parent.Touched:Connect( function (hit) |
06 | if hit.Parent:WaitForChild( "Humanoid" ) then |
08 | local PlayerName = hit.Parent.Name |
09 | local Multiplier = game.Players [ PlayerName ] .leaderstats.Multipliers.Value |
11 | hit.Parent.Humanoid.Health = 0 |
12 | local EsimateValue = HoleValue * Multiplier |
13 | game.Players [ PlayerName ] .leaderstats.Oofs.Value = game.Players [ PlayerName ] .leaderstats.Oofs.Value + EsimateValue |
On top of this, you would need to add some sort of conditional as this alone won't stop multiple points being given. As I don't want to spoon feed you the answer, and I also do not want to give you false information, I'll give you some prompts:
Wait a few seconds before switching debounce to false
Con: If two people touch it within that time, it will only work for the first
Store the player in a table, check if they're in it, wait for a period of time and then remove them
Con: There are easier ways
I will try to give you a proper answer when i'm not so tired