#Why this doesnt work?

1 messages · Page 1 of 1 (latest)

deep pivot
#
local function EnableControls()
    print("Controls Status: Enabled")
    local UIS = Enum.UserInputState
    
    -- Rotation is 0-indexed
    ContextActionService:BindAction("Rotate", function(_ActionName_, InputState, _InputObject_)
        if InputState ~= UIS.Begin then return end
        
        if IsShiftDown() then
            Rotation = (Rotation <= 0) and 5 or Rotation-1
        else
            Rotation = (Rotation >= 5) and 0 or Rotation+1
        end
        
        print("Rotation-num:",Rotation,"Rotation-vector:",RotationTable[Rotation])
    end, false, Enum.KeyCode.R)
    
    -- ColorID is 0-indexed
    ContextActionService:BindAction("ChangeColor", function(_ActionName_, InputState, _InputObject_)
        if InputState ~= UIS.Begin then return end
        print("C pressed")
        
        if IsShiftDown() then
            print("Shift is down")
            ColorId = (ColorId <= 0) and ColorTable_MaxKey or ColorId-1
        else
            print("Shift is not down")
            ColorId = (ColorId >= ColorTable_MaxKey) and 0 or ColorId+1
        end
        
        print("ColorId-num:",ColorId,"ColorId-color3:",ColorTable[ColorId])
    end, false, Enum.KeyCode.C)
end

Why Shift+R works fine but Shift+C doesnt do nothing? Someone can say if this can be fault of my keyboard?

edgy chasm
#

can you send the full script?