· 2 years ago · Oct 05, 2023, 08:10 AM
1@echo off
2
3rem Import the Roblox API module
4rem For Windows 10 or later:
5rem > Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
6rem > Import-Module RobloxAPI
7
8rem For Windows 7 or 8.1:
9rem > Set-ExecutionPolicy Unrestricted
10rem > Import-Module RobloxAPI
11
12rem Get the player's ID
13rem Prompt the user for the player's ID
14echo Enter the player's ID:
15set /p playerId=<nul
16
17rem Get the API key
18rem Prompt the user for the API key
19echo Enter the API key:
20set /p apiKey=<nul
21
22rem Get the player's current coin balance
23rem Use the API key to get the player's current coin balance
24rem The response will be in JSON format
25rem The `coins` key will contain the player's current coin balance
26$response = Invoke-RestMethod -Uri "https://api.roblox.com/users/%playerId%/coins" -Headers @{"Authorization"="Bearer %apiKey%"}
27$currentCoins = $response | ConvertFrom-Json | Select-Object -ExpandProperty coins
28
29rem Prompt the user for the amount of coins to add
30echo Enter the amount of coins to add:
31set /p amount=<nul
32
33rem Add the coins to the player's account
34rem Use the API key to add the coins to the player's account
35rem The response will be in JSON format
36Invoke-RestMethod -Uri "https://api.roblox.com/users/%playerId%/coins" -Method Post -Headers @{"Authorization"="Bearer %apiKey%"} -Body @{"coins"=$amount}
37
38rem Display a message to the user
39echo Added %amount% coins to the player's account.
40