For some reason when I press the Q key it does line 7 but not line 5,why and how do I fix it?
game.Players.PlayerAdded:connect(function(Player) PlayerMouse = Player:GetMouse() PlayerMouse.KeyDown:connect(function(Key) if Key == q then print(Key,"has been pressed") else print(Key,"is the wrong key") end end) end)
You forgot to put the 'q' into quotes (This is a quote: ");
game.Players.PlayerAdded:connect(function(Player) repeat wait(0)until Player:GetMouse() --I like to use this to wait until the script gets the Player's Mouse before going on PlayerMouse = Player:GetMouse() PlayerMouse.KeyDown:connect(function(Key) if Key == "q" then --Here we go, you Silly Billy :) print(Key,"has been pressed") else print(Key,"is the wrong key") end end) end)
Hope this helped!