Hehe, ive just added an if-then-end before it to check if its not tonumber( IAI )
I guess the small break from staring at code gave me a little brain boost.
p.s. thanks for your fast response btw MrJackdaw
edit-
Code:
ImageAmountInput:SetWantsKeyEvents( true );
ImageAmountInput.KeyDown = function( sender, args )
if args.Action == 162 then
OpWindow:Activate();
ImageAmountInput:SetSelection(1, 4);
IAI = ImageAmountInput:GetText();
IAI = tonumber( IAI );
if not tonumber( IAI ) then -- <--- Fixes everything
ImageAmountInput:SetText( "" );
print ( "You entered an illegal entry" );
elseif IAI >= 0 and IAI <= 9999 then -- ERROR produced here if string characters used in user input box. Need to figure out a way to ignore erroring.
ImageAmountInput:SetSelection(0,0);
end
end
end