Guest User

Untitled

a guest
Jul 21st, 2021
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2.  
  3. local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent") --Just change the path of the remote event to wherever you put it.
  4.  
  5. --Your Sword
  6. local DeluxeSword = ReplicatedStorage.DeluxeSword
  7.  
  8. --Cost Of Your Sword
  9. local deluxeCost = 15
  10.  
  11. function validatePurchase(player)
  12. if player.leaderstats.Currency.Value >= deluxeCost then
  13. local swordClone = DeluxeSword:Clone()
  14. swordClone.Parent = player.Backpack
  15. --Subtract the Money From the Player
  16. player.leaderstats.Currency.Value -= deluxeCost
  17. end
  18. end
  19.  
  20. RemoteEvent.OnServerEvent:Connect(validatePurchase)
RAW Paste Data