Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Do I Equip A Tool, Without Selecting it from the Backpack?

I want a game that shows no backpack, and lets me select a tool that I spawn into game.Workspace, from ServerStorage. I have already accomplished spawning the tool into game.Workspace through some remote event calls and a utility function I've created - I just need to know the best way to have it equipped. I've tried using:

player.Character.Humanoid:EquipTool(TOOL)

But this results in the standard Roblox "backpack" appearing - I don't want this. Any suggestions or ideas guys?

-Jason

3 answers

You can hide the Roblox backpack using SetCoreGuiEnabled. To Hide the backpack, just insert the following line anywhere in a LocalScript. Of course the Backpack can be switched out with, PlayerList, Health, Chat or All.

game.StarterGui:SetCoreGuiEnabled("Backpack", false)

I managed to get a tool to equip. All you need to do is clone the tool into the players backpack.

Hope this helps

function onTouch(part) 
	local plr = game.Players:GetPlayerFromCharacter(part.Parent) 
 	local wplr = part.Parent
	
	wplr.Humanoid:EquipTool(plr.Backpack.Tool)
end
script.Parent.Touched:connect(onTouch)

Thanks for trying guys, its appreciated - I'm having no problem doing what Kingdom5 did - that part is done with spawning a tool and equipping.

I've also done (before asking my question) what FearMeIAmLag is talking about, and things start great with no default backpack appearing, but as soon as I do the equip - it shows up! The default backpack shows up on my screen with the gun in one of the slots. I'd rather this not show up.

2 comments

0

What happens if you keep disabling the Core gui after equipping a tool?

0

If you disable Backpack after equipping a tool nothing happens, you just won't be able to view/unequip/equip the tools you have.

This discussion is preserved as it was. New answers, comments, and votes are closed.