You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? After the player changes the transparency of the image i want it so after 3 seconds its transparency is set to 1, but if it changed before its set to 1 then reset the timer ( sorry if i didn’t explain well )
-
What is the issue? The issue is, it’s making the transparency set to 1 immediately, and if i set a task.wait(time) it doesnt reset the timer.
-
What solutions have you tried so far? I tried searching things about tick() but yeah, im not good with it and i didn’t find any solution for my problem.
local function check()
local maxTime = 3
currTime = tick()
local passedTime = currTime - prevTime
for i=1,3 do
if passedTime >= maxTime then
task.wait(maxTime)
hideTween:Play()
return
end
end
end
visibilityInt.Changed:Connect(function()
if visibilityInt.Value == 1 then
visibleTween:Play()
visibleTween2:Play()
elseif visibilityInt.Value == 2 then
crouchingVisibleTween:Play()
crouchingVisibleTween2:Play()
elseif visibilityInt.Value == 3 then
hidingVisibleTween:Play()
hidingVisibleTween2:Play()
elseif visibilityInt.Value == 4 then
asSeenSound:Play()
asSeenFrameTransparency1:Play()
asSeenTweenSize1:Play()
asSeenTweenColor:Play()
local rotateTimes = 30
repeat
rotateTimes = rotateTimes - 0.3
eyeVisibility.Rotation = math.random(-rotateTimes,rotateTimes)
task.wait()
until rotateTimes <= 0
asSeenFrameTransparency2:Play()
asSeenTweenSize2:Play()
end
check()
end)
See the video, when i change it too fast the image gets invisible a lot faster than 3 seconds.
Help please