I'm new to scripting, so I'm just testing out some different types of tools. The tool I'm currently trying to make is a hopperbin that has multiple uses. So far, I've got most of it done, I just need to make it fire a rocket when the user presses the e key. Does anyone mind teaching me how to do this?
The code below is what I have so far:
function onKeyDown(key)
key:lower()
if key == "e" then
end
function onSelected(mouse)
mouse.KeyDown:connect(onKeyDown)
end
script.Parent.Selected:connect(onSelected)

3 comments
Key down is depricated
It still works for me, but what else should I use?
Um. For a beginner, KeyDown works... When you get advanced use UserInputService