So I made an ATM system that is supposed to change the value of 2 intvalues, but for some reason nothing happens.
Server:
local PlayerWalletAmount = Player.PlayerInfo.PlayerWalet.Value
local PlayerBankAmount = Player.PlayerInfo.PlayerBank.Value
print(Player)
print(Amount)
print(PlayerWalletAmount)
if PlayerWalletAmount >= Amount then
PlayerWalletAmount = PlayerWalletAmount - Amount
PlayerBankAmount = PlayerBankAmount + Amount
print("RemoteDone")
else
print("Too poor!")
end
end
GivePlayerToolEvent.OnServerEvent:Connect(GivePlayerTool)
WithDraw.OnServerEvent:Connect(WithDrawMoney)
Client:
local function WithDrawMoney()
local MoneyToWithDraw = tonumber(GUI.BankFrame.Frames.WithDrawFrame.TextBox.Text)
local Account = GUI.BankFrame.Decorations.AccountBalanceText.Text
local Wallet = GUI.BankFrame.Decorations.AccountBalance.Text
if MoneyToWithDraw then
local Remote = ReplicatedStorage.ExploitProtectionRemoteEvents.WithDrawMoney
Remote:FireServer(MoneyToWithDraw)
task.wait()
Account = Player.PlayerInfo.PlayerBank.Value
Wallet = Player.PlayerInfo.PlayerBank.Value
end
end
RemoteEvent.OnClientEvent:Connect(GuiOpen)
LogInButton.MouseButton1Click:Connect(LogInPress)
DepositButton.MouseButton1Click:Connect(DepositPress)
WithdrawButton.MouseButton1Click:Connect(WithDrawPress)
CloseButton.MouseButton1Click:Connect(CloseGUI)
GetMoneyButton.MouseButton1Click:Connect(GetMoneyPress)
Withdraw.MouseButton1Click:Connect(WithDrawMoney)
Output: