Advertisement
OnFireRobloxScriptin

Hold "E" to collect coin script (leaderstats not included)

Jul 23rd, 2023 (edited)
1,076
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 1 0
  1. --//Make sure your proximity prompt and script is under the coin
  2.  
  3. --//Variables
  4. local prox = script.Parent.ProximityPrompt --Variable for proximity prompt
  5.  
  6. prox.Triggered:Connect(function(player) --When the proximity prompt is triggered activate the function
  7.     local cash = player.leaderstats.Cash --Variable for the Player's Cash
  8.     cash.Value += 10 --Add 10 Cash (Change 10 to # of Cash you want to add for the Player)
  9.     script.Parent:Destroy() --Optional, delete if you don't want the coin to disappear after you collect it
  10. end)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement