I need help with an ATM that gives money when touched by a credit card, I already have the ATM and the credit card I just need the script
Help please, im a new developer with big dreams :)
Based on your question, you want money awarded to player if the player touches the atm with the creditcard. There are many way I can think of making this work, but here's 1 of the way:
ATM = script.Parent debounce = false --> Prevents spamming of card touching ATM ATM.Touched:connect(function(entity) if entity.Parent.Name == "Card" and debounce == false then debounce = true --Add money to the player's wallet, assuming wallet is an existing "IntValue" inside all your player (Put it inside of StarterPack) PlayerChar = entity.Parent.Parent player = game.Players:GetPlayerFromCharacter(PlayerChar) PlayerWallet = player.Backpack:FindFirstChild("Wallet") PlayerWallet.Value = PlayerWallet.Value + 100 --> Player Wallet increases by 100 everytime card touches atm. print(PlayerWallet.Value) --> printing your result to the output wait(1) --> Time frame (in secs) before Card can touch the ATM again debounce = false end end)
Since you didnt state where you've stored or want to store your money, I've assumed that you stored it in a "IntValue" named "Wallet".