Can Somebody please help me use TouchEnded Correctly?
local TweenService = game:GetService("TweenService")
local shopgui = script.Parent
local stroke = script.Parent.UIStroke
local part = workspace:WaitForChild("BuyCl")
local tweenInInfo = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local tweenOutInfo = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local tweenin = TweenService:Create(shopgui, tweenInInfo, {Transparency = 0})
local tweenout = TweenService:Create(shopgui, tweenOutInfo, {Transparency = 1})
part.Touched:Connect(function()
shopgui.Visible = true
stroke.Enabled = true
tweenin:Play()
end)
part.TouchEnded:Connect(function()
task.wait(1)
tweenout:Play()
stroke.Enabled = false
task.wait(0.3)
shopgui.Visible = false
end)