Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --//NO COOLDOWN VERSION
- script.Parent.Touched:Connect(function(hit) --When something touches the part, the script runs
- if hit and hit.Parent:FindFirstChild("Humanoid") then --Checks if a character touched the part
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) --If character then it will get the player using the character
- local leaderstats = player.leaderstats --Gets the player's leaderstats
- leaderstats.Points.Value += 5 --Adds 5 points to the player
- leaderstats.Wins.Value += 3 --Adds 3 win to the player
- end
- end)
- --//COOLDOWN VERSION
- local db = true --debounce
- script.Parent.Touched:Connect(function(hit) --When something touches the part, the script runs
- if hit and hit.Parent:FindFirstChild("Humanoid") then --Checks if a character touched the part
- if db == true then --If debounce then
- db = false --Sets debounce to false
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) --If character then it will get the player using the character
- local leaderstats = player.leaderstats --Gets the player's leaderstats
- leaderstats.Points.Value += 5 --Adds 5 points to the player
- leaderstats.Wins.Value += 3 --Adds 3 win to the player
- task.wait(2) --Cooldown timer, change the number in brakets to how many seconds you want the cooldown to be
- db = true --Sets debounce to true
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement