I am trying to print "test" when the button "q" is pressed. Here is the code I'm using.
ms = game:GetService("Players").KDarren12:GetMouse()
ms.KeyDown:connect(function(key)
if key == "q" then
print('test')
end
end)
I get the error: "Attempt to index global 'ms' (a nil value)". Any help would be appreciated. Thank you.
Edit(I am using this code on a Client Side script, not a LocalScript.)

1 comment
um there is server script and there is local script, server script is for the entire server to see and local script is for the local player to see