#Tween PROBLEM
10 messages · Page 1 of 1 (latest)
** You are now Level 6! **
it goes to same properties as properties 1, just goes up not down
how it should go down if you don't change position?
i changed position2 to this which is the top
so when its played the bar only goes up but not down
local tweenService = game:GetService("TweenService")
local uis = game:GetService("UserInputService")
--gui stuff--
local gui = script.Parent
local BackGround = script.Parent.BackGround
local BackGroundPosition = Vector3.new({0.193, 0},{0.197, 0})
local FishHolder = BackGround.Bar.FishHolder
local properties1 = {
["Position"] = UDim2.new({0, 0},{0, 0})
}
local properties2 = {
["Position"] = UDim2.new({0, 0},{0.84, 0})
}
local tweeninfo = TweenInfo.new(5, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local tweeninfo2 = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local tweenUp = tweenService:Create(FishHolder, tweeninfo, properties1)
local tweenDown = tweenService:Create(FishHolder,tweeninfo2,properties2 )
local holding = false
local function UpdateBar()
if holding then
tweenDown:Pause()
tweenUp:Play()
print("up")
else
tweenUp:Pause()
tweenDown:Play()
print("down")
end
end
uis.InputBegan:Connect(function(input,gp)
if not gp then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 and not holding and gui.Enabled then
holding = true
UpdateBar()
end
end)
uis.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and holding then
holding = false
UpdateBar()
end
end)
Event.OnClientEvent:Connect(function()
gui.Enabled = true
end)```