I plan on making a one piece game, and the important parts of it include various abilities. Basically my question is, when a tool gets equipped is it possible for that tool to have different keybinds? Is that possible? If so how?
1 Like
Yeah but how do I place the UserInputService in a tool?
Dude, UserInputService is a service. You need to scripting it.
I understand that, but could I script that user input service into a tool like the script below?
tool.Equipped:Connect(function())
uis.InputBegan:Connect(function())```
This
For example I want X key.
Uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.X then
print("X key is printed!")
end
end)
You could make a variable saying if the tool is equipped, allow UIS to do the job, otherwise don’t let it.
1 Like
How would I go about doing that? I’m a beginner, sorry…
I don’t think you should start scripting big stuffs like that first. It gets a bit complicated but you would use a Boolean value and use conditional statements.