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

Tool Keybind? How do you make players use a tool when pressing a key?

Asked by
Gingerely 245 Moderation Voter
5 years ago

Uh, so I tried to make a script that would allow me to equip a tool when i press q, however I had some problems with it, I'm also new to scripting so anything would be helpful.

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

Mouse.KeyDown:connect(function(Key)
    if(Key:lower() == "q") then
        Player.BackPack.ClassicSword:Equip()
    end
end)
0
Take a look at UserInputService...https://developer.roblox.com/en-us/api-reference/class/UserInputService https://developer.roblox.com/en-us/api-reference/function/UserInputService/IsKeyDown ForeverBrown 356 — 5y
0
thank you Gingerely 245 — 5y
0
Gingerely do you have discord? I have a feeling you might end up needing more help MrCatDoggo 213 — 5y
0
yeah bro add up Gingerely#7439 Gingerely 245 — 5y

Answer this question