So i made a script to open a gui when you press a key but if you will mash the key the gui will kinda brake. I want to know if there is a way to block they key when the gui is tweening so it doesnt bug it out
button = script.Parent.button
frame = script.Parent.Parent.ColorsAvailable.Frame
stop = script.Parent.button.waiting
stop1 = script.Parent.button.waiting.dot1
stop2 = script.Parent.button.waiting.dot2
stop3 = script.Parent.button.waiting.dot3
text = script.Parent.button.TextButton
mouse= game.Players.LocalPlayer:GetMouse()
a=0
mouse.KeyDown:connect(function(key)
if (string.lower(key) == "c") and (a==0) then
a=1
game.Soundscape.buttonpress.PlaybackSpeed = 1
game.Soundscape.buttonpress:Play(1)
frame:TweenPosition(UDim2.new(0.2,-100,0.9,0), 'Out', 'Quad', 0.35)
button:TweenPosition(UDim2.new(0.2,-100,0.8,20), 'Out', 'Quad', 0.175)
text.Visible = false
stop.Visible = true
wait(0.0875)
stop1.Visible = true
wait(0.0875)
stop2.Visible = true
wait(0.0875)
stop3.Visible = true
wait(0.0875)
text.Visible = true
stop.Visible = false
stop1.Visible = false
stop2.Visible = false
stop3.Visible = false
elseif(string.lower(key)=='c') and (a==1) then
a=0
game.Soundscape.buttonpress.PlaybackSpeed = 1.5
game.Soundscape.buttonpress:Play(1)
frame:TweenPosition(UDim2.new(0.2,-100,1,0), 'In', 'Quad', 0.35)
button:TweenPosition(UDim2.new(0.2,-100,0.9,0), 'In', 'Quad', 0.35)
text.Visible = false
stop.Visible = true
wait(0.0875)
stop1.Visible = true
wait(0.0875)
stop2.Visible = true
wait(0.0875)
stop3.Visible = true
wait(0.0875)
text.Visible = true
stop.Visible = false
stop1.Visible = false
stop2.Visible = false
stop3.Visible = false
end
end)

3 comments
Yup that helped. Thank you for your fast response, probably avoided me hours of scratching my head )))
Glad it helped. Please accept answers :)
Did it mate)