Posted 02 August 2017 - 09:12 AM
Hi all
Im having some trouble with a script
There's a pice in it that gives the user a [Y/N] prompt,
but after the prompt it still types the character that's chosen.
[indent=1]local event,key = os.pullEvent("key")[/indent]
[indent=1]if key == 21 then[/indent]
[indent=1]somescript()[/indent]
[indent=1]elseif key == 49 then[/indent]
[indent=1]– some code –
end[/indent]
[indent=1]Function somescript()[/indent]
[indent=1]write("id: ")[/indent]
[indent=1]id = read() – This is where the character shows up[/indent]
[indent=1]– some more code –[/indent]
Is there some way to prevent the char-event from firing, or to prevent the character showing up when i use read?
Thanks in advance!
Im having some trouble with a script
There's a pice in it that gives the user a [Y/N] prompt,
but after the prompt it still types the character that's chosen.
[indent=1]local event,key = os.pullEvent("key")[/indent]
[indent=1]if key == 21 then[/indent]
[indent=1]somescript()[/indent]
[indent=1]elseif key == 49 then[/indent]
[indent=1]– some code –
end[/indent]
[indent=1]Function somescript()[/indent]
[indent=1]write("id: ")[/indent]
[indent=1]id = read() – This is where the character shows up[/indent]
[indent=1]– some more code –[/indent]
Is there some way to prevent the char-event from firing, or to prevent the character showing up when i use read?
Thanks in advance!