Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Choose Shift Key over 0?

Asked by 10 years ago

I can't figure out how to make a script determine whether you press the shift key, or the 0 key. They apparently share the same byte code.

local player = game.Players.LocalPlayer; 
local mouse = player:GetMouse(); 

game.StarterGui:SetCoreGuiEnabled("Backpack", false); 

mouse.KeyDown:connect(function(key) 
    if (key:byte()==48) then 
        print("Left Shift");  -- Pressing 0 will also print left shift. How do I prevent this?
end end); 

Answer this question