Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

Log in to vote
1
Answered by 9 years ago

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)
Ad
Log in to vote
1
Answered by 9 years ago

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)
Log in to vote
0
Answered by 9 years ago

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.

0
What happens if you keep disabling the Core gui after equipping a tool? chess123mate 5873 — 9y
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. User#22889 0 — 5y

Answer this question