Advertisement
OnFireRobloxScriptin

Roblox Stat Block Script

Apr 28th, 2023 (edited)
5,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. --//NO COOLDOWN VERSION
  2.  
  3. script.Parent.Touched:Connect(function(hit) --When something touches the part, the script runs
  4.     if hit and hit.Parent:FindFirstChild("Humanoid") then --Checks if a character touched the part
  5.         local player = game.Players:GetPlayerFromCharacter(hit.Parent) --If character then it will get the player using the character
  6.         local leaderstats = player.leaderstats --Gets the player's leaderstats
  7.         leaderstats.Points.Value += 5 --Adds 5 points to the player
  8.         leaderstats.Wins.Value += 3 --Adds 3 win to the player
  9.     end
  10. end)
  11.  
  12. --//COOLDOWN VERSION
  13.  
  14. local db = true --debounce
  15.  
  16. script.Parent.Touched:Connect(function(hit) --When something touches the part, the script runs
  17.     if hit and hit.Parent:FindFirstChild("Humanoid") then --Checks if a character touched the part
  18.         if db == true then --If debounce then
  19.             db = false --Sets debounce to false
  20.             local player = game.Players:GetPlayerFromCharacter(hit.Parent) --If character then it will get the player using the character
  21.             local leaderstats = player.leaderstats --Gets the player's leaderstats
  22.             leaderstats.Points.Value += 5 --Adds 5 points to the player
  23.             leaderstats.Wins.Value += 3 --Adds 3 win to the player
  24.             task.wait(2) --Cooldown timer, change the number in brakets to how many seconds you want the cooldown to be
  25.             db = true --Sets debounce to true
  26.         end
  27.     end
  28. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement