So. I'm trying to get a gui to become more visible when you press "Left CTRL". The Key detector works, and when I try fire the loop, it becomes instantly visible, not going through the other transparency's.

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
 
Mouse.KeyDown:connect(function(Key)
    if Key == string.char(50) then
		if script.Parent.BackgroundTransparency == 0.6 then
			for i = 0.6,0,-0.1 do
   				script.Parent.BackgroundTransparency = i
			end
		else
			for i = 0,0.6,0.1 do
   				script.Parent.BackgroundTransparency = script.Parent.BackgroundTransparency[i]
			end
		end
	end
end)

2 comments

0

(Add some waits in your for loops)

0

script.Parent.BackgroundTransparency = script.Parent.BackgroundTransparency[i].. this doesn't look right, idk.