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
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.