I know how to cover the backpack and chat UI's ~~~~~~~~~~~~~~~~~ local startergui = game:GetService('Startergui') startergui:SetCore(Enum.CoreGuiEnabled, false) --I think I wrote that wrong lol ~~~~~~~~~~~~~~~~~
But now I cannot equip tools. If you want a reference for this to compare it to guns in phantom forces. Are they tools? Or is it just creating an instance that is offset from the local player using them?
Make sure to take a look at this post to see how to properly format on ScriptingHelpers. You also have the Preview tool when writing out a question to see how it looks before you post.
local startergui = game:GetService('Startergui') startergui:SetCore(Enum.CoreGuiEnabled, false) --I think I wrote that wrong lol
First, your code doesn't do anything because it's wrong. :SetCore()
, a function of StarterGui, that allows you to use Roblox CoreScripts. It does not take Enum.CoreGuiEnabled
when such an Enum doesn't exist.
You probably mean to use :SetCoreGuiEnabled()
to toggle CoreGui. An example disabling all CoreGuiTypes can be done as:
local StarterGui = game:GetService('StarterGui') StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
The above disables all including the Backpack that you speak of. When you disable the Backpack with this method, it also disabled the inventory or 'hotbar' for the player. To get around this you could use the :EquipTool()
function from the Humanoid to equip a Tool object for the player.
Last thing is that Phantom Forces definitely uses their own custom tool system apart from the default Tool object that Roblox provides. Making your own custom tool system would provide more functionality depending on how you make it.
You'll need to experiment with UserInputService
or ContextActionService
to get player input and make your own functions to un/equip.