Thanks to ax_gold, got this working script now:
local player = game.Players.LocalPlayer
local backpack = player.Backpack
local character = player.Character
local primary = backpack.Primary
local secondary = backpack.Secondary
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.One then
primary.Parent = character
secondary.Parent = backpack
elseif inputObject.KeyCode == Enum.KeyCode.Two then
secondary.Parent = character
primary.Parent = backpack
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false);
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false);
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false);

1 comment
I've pulled handfuls of hair, it's a fairly steep learning curve.