Replacing core Roblox scripts

I am attempting to create a customised backpack for my game. I have found a way to disable the backpacks core script by using SetCoreGuiEnabled(), but do not know how to replace it with my own by setting my own script as the core script. Could someone tell me the correct way to set my own script as the core backpack script.

If you have already disabled the core script of Backpack, there is no necessity of making your script the core. Make it like any other Gui - design the Gui and then add LocalScripts to it. In the LocalScripts, you can just script your bagpack.