Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent") --Just change the path of the remote event to wherever you put it.
- --Your Sword
- local DeluxeSword = ReplicatedStorage.DeluxeSword
- --Cost Of Your Sword
- local deluxeCost = 15
- function validatePurchase(player)
- if player.leaderstats.Currency.Value >= deluxeCost then
- local swordClone = DeluxeSword:Clone()
- swordClone.Parent = player.Backpack
- --Subtract the Money From the Player
- player.leaderstats.Currency.Value -= deluxeCost
- end
- end
- RemoteEvent.OnServerEvent:Connect(validatePurchase)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement