I need help with a Code Executer

Oh and I do not use github lol

Personally I wouldn’t really recommend using H6x if you are a beginner because even though its designed to be pretty easy to use it would be easy to misuse it too, its made to be a tool for creating a sandbox yourself so you can let people write code.

(H6x also uses loadstring underneath by the way, as do most games that run inputted code on Roblox)

It’s not really good if you just want to be able to run some code, its designed for people who know a little bit about how things like getfenv, getmetatable, etc can be abused, and how different instances in Roblox might be abused. It’s not really a beginner tool at all.

There is no Roblox website link, the file download for H6x is uploaded directly to the devforum. The reason for this is that the project is still in relatively early stages, so, it doesn’t make much sense for me to upload it yet and make it easily accessible. You can import it into studio like any normal Roblox model file (by dragging and dropping or by right clicking an instance and selecting Open from File)

GitHub is just a location to host code, you don’t need to use GitHub to use the code that’s hosted there. Its not much different from uploading something to Google drive or Dropbox other than for the person writing the code and people who want to contribute to it and submit things.

Small note about this, H6x is technically sandboxed but it is not going to stop people from doing malicious things in your game unless you set it up that way. It’s more a tool to create a sandbox vs being its own sandbox.

H6x is basically meant to do the heavy lifting of security and knowing all the little quirks about different features in the engine, but, if you tell the sandbox “hey give this script access to literally everything” its just going to “securely” give it access to literally everything (which is obviously not very secure, its basically just as effective as loadstring at that point)

1 Like

Well do you have any solutions on how I can execute code on a local script to make my local and server replicator of firing code?

Do you think you can go on studio with me and help? Or insert the code? please

What is getfenv() by the way? lol

Roblox doesn’t provide any way of executing code locally (since exploiters could just use Roblox’s code for that to run their scripts) so you won’t really be able to.

You can run server code with the dev console in your games (press F9 in game and go to the Server logs, there is a bar at the bottom where you can type or paste in lua code to run, and, then you can just hit enter and it’ll run)

If you want to run client code from the dev console you’d have to load it from Roblox. You can do that by creating a ModuleScript and calling it MainModule (this tells Roblox that its the main module so you can use require and give the id of it once you upload it). You can put a LocalScript inside of the MainModule, and in your MainModule you can Parent the LocalScript somewhere where it will run for you. Then just save the ModuleScript to Roblox by right clicking it and selecting Save to Roblox, that way you can require it. You just need to copy its id, and then you can run require(assetId) and the module will run.

One way that might be easy to do all of that would be to use game.CreatorId and do Players:GetPlayerFromUserId(game.CreatorId), or you can give it a specific player if you make the module return a function to parent the local script instead. You can parent the local script to player.Backpack and it will run for them. So, then, when you want to run some local code, you can edit it in studio, right click on MainModule, and select Save to Roblox, then you can require the asset id.

(P.s. when you require a module it gets cached, so, if you update it, and try to require it again after you’ve already required it in that server it will be the old module… I can help you come up with a better but maybe more confusing way if you want, that wouldn’t use modules but would still involve uploading a script)

I can’t really do this, but, I don’t think H6x is actually what you want anyways, since you said in your post you just want to run code for yourself. H6x is meant for the few games that will want to run other people’s code in them.

1 Like

You can read about it on the devhub here: Lua Globals (roblox.com)

Just press Ctrl+F and you can type in getfenv and it’ll show up

1 Like

Yes not my command bar thing with F9 I will show you right here



I want the client to work :slight_smile:

There isn’t really a way to do that, you kind of just have to deal with uploading your scripts to Roblox and then you can load them with require(assetId) or you can use InsertService:LoadAssetVersion() which can load something you upload to Roblox, like a LocalScript that you can put into your Backpack, so, that way you can run local code.

Also, if you join your game, press F9, it will open the developer console which is a console you can use, it lets you run code. That’s what @Unknownstaffmembe was showing you and that’s what I was trying to say before:

If you are a developer of a game (so, if you have edit access) you can use this in any of your games, its part of Roblox, there isn’t anything you have to download or add.

Then how come I see other people do it with client code?

Like in Void Script Builder? Void Script Builder is the one example of a game I know of that can run local code.

I believe Void Script Builder has a website set up and they can tell their website to upload a local script to Roblox, and then they can load the script once its uploaded via InsertService. That’s how one of their moderators explained it to me.

I know they also used to use a lua in lua executor (basically the code for the lua itself but rewritten in lua instead of C, so, “lua in lua”) a long time ago but those are really outdated and I don’t know of any that work very well and you probably can’t find them easily.

Oh well then my Whole idea is just gonna be gone now :frowning: Well do you wanna atleast be friends?

What was your idea? Do you have anything you are trying to do with being able to execute code?

Yes I am trying to do stuff inside my RP game without game console but I now cannot :frowning:

Technically Trolling Gui :grinning_face_with_smiling_eyes:

You can still upload a script and load it with the dev console though!

If you want to run a local script there are still ways you can do it as long as you are uploading it. You can have studio open and you can write whatever code you want to run into your local script. Then you could have a button in your gui that loads your script that you saved, or you could do it from the dev console.

You could make it run server scripts the same way if you wanted to, and, you could even load in other Instances you put inside of it.

How would I make the code into the devconsol fire into the localscript?

You wouldn’t be able to put the code in from inside of your game, but, you could put your code in from in studio and then you could save the script. Then in your game you can have it load the saved script.

Since you just want to do it for you, that means instead of using your GUI to type the code you can type the code into your LocalScript that you saved to Roblox’s website. Then in your GUI you can make it so that it will load that script off of Roblox when you click a button for example.

You can look at these functions, they are what you would use to load the script you saved into the server:
InsertService:LoadAsset (roblox.com) - This will let you load it once, the next time you try to load it Roblox will reuse the one it already loaded (Which is called caching, to help prevent lag for people who might be using this a lot Roblox will just reuse the one it already got, since, when you load an asset the Roblox server is basically downloading it from Roblox’s website… If you called it 100 times and it didn’t cache, it would be kind of like downloading 100 files)

InsertService:GetLatestAssetVersionAsync (roblox.com) - You can use this and the function below to load the latest version of your LocalScript. This just returns a long number that tells Roblox what specific version of the script you want to load.
InsertService:LoadAssetVersion (roblox.com) - This lets you load a specific version of something into the game. It works kind of like LoadAsset, but, it will only cache for that version. So if you load version 123456 5 times it will only download it one time, but if you load version 123456 and then load version 123456789 it will download each one separately.

That function just returns the instances you saved inside of a Model instance, so you can do something like this:

local assetId = 1234 -- The id of the asset you are loading
local InsertService = game:GetService("InsertService")
local scriptHolder = InsertService:LoadAssetVersion(InsertService:GetLatestAssetVersionAsync(assetId)) -- Load the asset

local localScript = scriptHolder:WaitForChild("LocalScript") -- Get the local script from it that you saved
localScript.Parent = player.Backpack -- Put it in the backpack of the target player. (This lets you run code for other people too by changing the player)

That’s just a basic example, you could put that into the dev console if you wanted to and load your script.

1 Like