Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local button = script.Parent
- local gun = game.Lighting.AssaultRifle
- local cost = 12
- local debounce = {}
- button.Touched:connect(function(part)
- local player = game.Players:GetPlayerFromCharacter(part.Parent)
- if player and not debounce[player] then
- debounce[player] = true
- local stats = player:findFirstChild("leaderstats")
- local currencyHolder = stats and stats:findFirstChild("KOs")
- local currencyValue = currencyHolder and currencyHolder.Value
- if currencyValue and currencyValue >= cost then
- gun:clone().Parent = player.Backpack
- button.BrickColor = BrickColor.new(1004)
- wait(0.1)
- button.BrickColor = BrickColor.new(1001)
- end
- debounce[player] = nil
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment