How to make your own CoreScript

DISCLAIMER: DO NOT USE THESE IN LIVE GAMES/OUTSIDE OF ROBLOX STUDIO, IT IS THEN CONSIDERED EXPLOITING IF SO!

NOTE: This seems to not work anymore for current versions of Studio, but it should work for older versions. I am using a version from June this year and it works just fine.

Hello, I’m p0s_0! I recently made my own CoreScript, and I learned some stuff from creating one. I decided I would make a tutorial and share my knowledge about it. This is my first tutorial, so please let me know in PMs if I can improve it.

Alright, so first off, go to C:\Users\(username here)\AppData\Local\Roblox\Versions, then find the version with RobloxStudioBeta.exe and copy everything in that folder to a new folder wherever you want, then name it whatever you want.

Alright, so now, let’s open up Roblox Studio! Double-click the RobloxStudioBeta.exe in the folder you just copied, then, if you’re not already, sign in. Make a new empty Baseplate now.

Alright, now that you’ve done that, let’s create our first CoreScript! Go back to the folder you just made, and go to \ExtraContent\scripts\CoreScripts. Now go to \CoreScripts and create a new file. Make sure it has the .lua file extension at the end, then open it in a text editor or make a LocalScript in Roblox Studio, and when you’re done open the file and copy it over. I’ll use Roblox Studio for writing the code and Notepad++ as my text editor.

My CoreScript is named TestCoreScript.lua
image

Alright, now write your script! Let’s get into some of the basics of a CoreScript:
Game.CoreGui: This is the CoreGui. It stores almost all of the GUIs from CoreScripts in there. You may notice another GUI in there named RobloxGui. We’ll get into that in a moment.

Game.CoreGui.RobloxGui: This is where some of the Roblox CoreGui’s are stored. AFAIK the Main Menu is stored there.

Game.CoreGui.CoreScripts/(core script name here): This is a CoreScript object. We’ll get more into these later.

Alright, now let’s write our (probably) first CoreScript! Here’s some sample code:

--[[
This is a random comment. Idk, just write some info about your CoreScript here.
That's what I use these for most of the time or just documentation.
--]]
local Player = game.Players.LocalPlayer -- We might need this.
local CoreGui = game:WaitForChild("CoreGui") -- Cannot be used in a normal script, or you will get a Class security check error.
-- Some random functions.
function createLabel(Name, Parent, Size, Pos, Text)
local Label = Instance.new("TextLabel")
Label.Parent = Parent
Label.Name = Name
Label.Size = Size
Label.Position = Pos
Label.Text = Text
Label.BorderSizePixel = 0
Label.BackgroundTransparency = 1
Label.Visible = true
end

function createFrame(Name, Parent, Size, Pos)
local Frame = Instance.new("Frame")
Frame.Parent = Parent
Frame.Name = Name
Frame.Size = Size
Frame.Position = Pos
Frame.BorderSizePixel = 0
Frame.BackgroundTransparency = 0.5
Frame.Visible = true
end
-- Create GUI objects
createFrame("CoolCoreFrame", CoreGui:WaitForChild("RobloxGui"), UDim2.new(0, 300, 0, 300), UDim2.new(0.5, -150, 0.5, -150))
createLabel("CoolCoreLabel", CoreGui:WaitForChild("RobloxGui"):WaitForChild("CoolCoreFrame"), UDim2.new(0, 200, 0, 100), UDim2.new(0, 0, 0, 0), "Hi!")
print("Alright, if this prints, we should've done it!")
-- End of Script

Alright, now save your .lua file! Now, we need to modify the StarterScript.lua to make our CoreScript work. Go back to \ExtraContent\scripts\CoreScripts, and scroll down to the bottom. Now type:

ScriptContext:AddCoreScriptLocal("CoreScripts/(your core script name here)", RobloxGui)

Make sure you DON’T INCLUDE .lua! Now, save the StarterScript.lua, and try to play-test the Baseplate you made. It should add a Frame to the Game.CoreGui.RobloxGui ScreenGui. If not, check your code. I tested it and it worked just fine for me.

Keep in mind this doesn’t document all of the features you can now use with a CoreScript and that if you use these for your own game these won’t be given to other players unless you somehow find a way to do that.

That’s all, please let me know how I can improve this if you find any ways to improve it. This is my first tutorial, after all.

Now, go use your imagination, maybe make your own in-game menu, which I will probably go do after I post this tutorial. It’s actually quite fun in my opinion.

Thanks,
p0s_0

17 Likes

Its worth noting that doing this is against the Roblox TOS if done in live games as this is technically exploiting, you should only do this in test environments of Studio.

9 Likes

Alright, I edited the post to include a disclaimer. Thanks!

2 Likes

I don’t even think you could upload games with different CoreScripts. Roblox would just remove the added CoreScripts from the published place.

6 Likes

This can only be done in Studio as CoreScripts are precompiled and embedded inside the client for live games

6 Likes

How is this a breaking the Roblox TOS?
And what harm can a CoreScript do?

2 Likes

It’s considered exploiting if you somehow manage to put a CoreScript in the RobloxPlayer folder and not the RobloxStudio folder and it runs. A CoreScript can do tons of harm since according to the CoreScript API reference you can use functions that are only available to the RobloxScriptSecurity security level.

2 Likes

Does not work.

It’s broken, It won’t create a frame.

3 Likes

Does this still work, I tried it in a copied version and the most recent version and nothing changed. I even tried printing something and instancing a part in the ServerStarterScript and StarterScript lua files under ExtraContent\scripts\CoreScripts and nothing happened. So I am not sure that the scripts under the CoreScript folder are even running but I could very well be wrong.
If anyone knows how to make and run CoreScripts in the current version of Roblox, I would love to learn how!

Firstly, it doesn’t work anymore.

Also, it only worked in studio some time ago.

I doubt that roblox would remove this. For one, the corescripts folder is still in the versions, and if they removed corescripts, why would it be there? Also roblox has recently had a hack week showcase and I am fairly certain that people who entered in it used corescripts to achieve/make what they did unless they are all roblox employees who have access/more knowledge about how to change stuff studio.

that was kinda vague, but I hope you get my point

I would try to modify the StarterScript and add your CoreScript there.

Doesn’t work in Studio anymore… I removed the CoreScripts folder in the Studio folder client, and the scripts still load

3 Likes

Oh, so if I wanted to change roblox studio, I would just change the default scripts that are found in that version. Before I though you meant modify a starter script inside the core script folder but I guess you meant in a default script folder. I will try this out when I get the chance to :grinning:. Also thanks for pointing that out @Danny73244

You’re probably using the wrong version
(Sorry im late)