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

How to equip a tool when pressing a keybind?

Asked by
Galicate 106
6 years ago

I have a keybind script, and I want the player to be able to equip a tool when he/she presses Q, except I dont know how to make the tool equip after pressing Q. I tried game.Players.LocalPlayer.Backpack.Item:Equip()

local Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(Key)
    if(Key:lower() == "q") then
        Player.BackPack.PDA:Equip()
    end
end)

1 answer

Log in to vote
0
Answered by 6 years ago

Through the Roblox default backpack system it's pretty simple! Here's a source to help you out. Tell me if you come across any issues and don't forget, this is on the Humanoid! (not the player directly)

Ad

Answer this question