Just make the buttons invoke the code?
like
function Q()
--do something
end
--Assume the Mouse object is obtained from somewhere
Mouse.KeyDown:connect(function(Key)
if Key == "Q" then
Q()
end
end)
--Assume QGui is a button of some sort
QGui.MouseButton1Click:connect(Q)
-orangegreenblue, the Lua Noob |