How to make a Roblox Bot using Roblox API!

Here’s my thoughts:

  • You should use a Roblox library instead of managing the cookie yourself. There’s no point in reinventing the wheel - libraries like noblox.js and rblx simplify this process for the developer.
  • TypeScript is unnecessary for this tutorial, as you don’t seem to utilize types anywhere
  • Going along with the last one, if TypeScript isn’t required, you don’t need to install VSC and can dive straight into Replit from the beginning.
2 Likes

although this is the case most of the time, for this example we were setting the about page. Which can’t be done with noblox. And dont get started with rblx, why would I want to use a module with 6 weekly downloads?

You dont only need to use typescript for types. I prefer to use typescript as that will show errors inside the code. Rather than testing it and then realizing there’s an error

You could, but replit doesn’t have a very good ide experience. I prefer to write code in VSC and move to replit.

it seems like you didn’t even read the guide and simply went through it with all this nonsense criticism

2 Likes

Both noblox and rblx are just examples (although rblx does allow you to set a description). You’re able to use any library you want; the point is that for a beginner’s tutorial on how to use NodeJS to make a Roblox bot, it should be simple & beginner-friendly. A simple method like user.setDescription() is much friendlier than sending an HTTP request with node-fetch.

That’s true, but this is a beginner’s tutorial. Simplification is key if you want to really have the end-user understand exactly what you’re doing. Plus, they shouldn’t need to worry about errors if they’re using code from a tutorial.

Again, simplification. The copying from the out dir, discarding the old .env file, and installing local packages when you don’t need them are extra steps that can confuse the reader. It’s better to have a few well-explained steps than many steps that can leave the reader with questions.

Criticism is normal, and my points aren’t necessarily wrong. I don’t benefit from giving my criticism - you do. I’m giving you my thoughts on how you can improve this tutorial so future viewers will understand how to reach the end result without potentially leaving with questions, like why TypeScript was necessary, or why there’s a code editor and a decently sized node_modules folder on their hard drive that’s not being used. By diving straight into Replit, the VSC & NodeJS/npm installations can be skipped.


If you’d like to continue this, my DMs are open :slight_smile: I don’t want to further clog this thread.

3 Likes

yeah, many people like me dont have enough money to buy a VPS. But a VPS is indeed a good solution for hosting

2 Likes

There’s a section at the end of the tutorial where it pings the hosting URL, but even that isn’t effective as repls will completely refresh every once in a while and therefore stops the setInterval loop.

@TheH0meLands
I would look into UptimeRobot. The free tier is enough and has kept my Discord bots alive for well over a year.

3 Likes

hmm seems like a good idea. I used this method of pinging for a lot of my bots and didn’t encounter any down time. While with uptimerobot, my bot would go down every once in a while. I’ll try looking into it and update the guide as needed.

2 Likes

Replit doesn’t allow Roblox cookies. If you use a Roblox cookie on replit then the cookie will be reset.

it’s never happened to me? I believe cookies only reset when someone logs into your account from a different IP. Not when you use the roblox api(i think)

so it’s not possible to use cookies on replit then.

?? I just said that cookies dont reset when u use the roblox api. Only when you log into the account from a different ip? Am I misunderstanding?

I use the replit to host all my bots and I have no issues with cookies resetting.

yeah your misunderstanding bro, replit resets the cookie since replit has its own built in ip and you cant fix that

theres not even an issue in the first place. The cookie doesn’t reset on replit. It only resets when another ip logs into your account.

Bots use the roblox api to do actions. Cookies only reset when someone logs into your account from a different ip. Using the roblox api on behalf of another account doesnt(i believe.)

I use replit for all my bot hosting and I was able to host my bot for around 2 months straight and no cookie resetting whatsoever.

bro learn to read I didn’t say it resets because of apis it resets because replit resets it due to replit having a ip built in.

theres no need for you to be rude. Im simply saying the cookie wont reset whatsoever due to replit. Would you please provide some sources?

I assume you’re talking about the ip changes resetting cookies. But that only affects you when someone logs into your account, not when you use the roblox api.

1 Like
const noblox=require('noblox.js')

const token=process.env.TOKEN; // .ROBLOSECURITY

async function startApp () {
    const currentUser=await noblox.setCookie(token) // This will cause to reset cookie on replit
    console.log(`Logged in as ${currentUser.UserName} [${currentUser.UserID}]`)
}
startApp()

bro what’s wrong with you, show me when I said it does? bet u can’t

there is no reason Roblox would reset cookies for using the API
unless you use replit because it resets the cookie due to replit IP.

my cookie doesn’t reset? It’ll still say the account im using and im still logged in on the site.

I think you’re just arguing for the sake of arguing. And again, no need to be rude whatsoever. Being rude won’t get you anywhere.

1 Like

bro being rude is the key else yall people wouldn’t listen :skull:
and im not even being rude lol

Ok found a way to use cookies on replit.

Step 1: Connect to a American IP Using VPN.

Step 2: Login to your Roblox bot account.

Step 3: Copy the .ROBLOSECURITY and paste it into your cookie variable in replit.

1 Like