basically, i have a tween that should change transparency of a TextLabel. however, the tween doesnt show, although it does play. this is what it looks like:
some of the code:
local W = PlayerGui:WaitForChild("W")
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Quad, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local Wtween = TweenService:Create(W.TextLabel, tweenInfo, {Transparency = 1})
Wtween.Completed:Connect(function()
W.TextLabel.Transparency = 0
end)
function chooseKey()
local ChosenKey = math.random(1,5)
if ChosenKey == 1 then
W.Enabled = true
print("W")
wKey = true
aKey = false
sKey = false
dKey = false
spaceKey = false
end
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W and wKey then
W.Enabled = false
KeyPressed = true
Wtween:Play()
task.wait(.5)
chooseKey()
end
end)
chooseKey()
Put your key stuff before the tween, it would make sense since the script will need to figure out what youāre doing, and then what is going to happen after that.
Try moving the āUIS.InputBeganā block outside the chooseKey function. You only want to connect to that once. Also, set wkey = false right after
āif input.KeyCode == Enum.KeyCode.W and wKey thenā
That will act as a debounce so the tween only plays once.