Hi, I’m Blame.
I’m trying to make a simple script where it would allow you to take 4 sips of the cup, and whatever is inside the cup will slowly go down until the cup is empty, the issue is that when trying to tween the size, it ends up going to the middle of the cup and not the bottom. Also it doesn’t change the size when sipstaken is 2-3 (I think, because when it prints nothing happens and it says the number went up one)
Thanks in advance!
CODE:
local TweenService = game:GetService("TweenService")
debounce = false
sipstaken = 0
sipsallowed = 4
local part = script.Parent.Filling
script.Parent.Activated:Connect(function()
if not debounce then
if sipstaken >= sipsallowed then
local Goal4 = {Size = Vector3.new(0.173, 0.67, 0.71)}
local tweenInfo4 = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Tween4 = TweenService:Create(part, tweenInfo4, Goal4)
part.Position = Vector3.new(17.995, 2.689, -0.555)
Tween4:Play()
Tween4.Completed:Wait()
script.Parent.Name = "Empty Regular Size"
else
debounce = true
sipstaken = sipstaken + 1
print(sipstaken)
if sipstaken == 1 then
local GoalOne = {Size = Vector3.new(0.523, 0.67, 0.71)}
local tweenInfo1 = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Tween1 = TweenService:Create(part, tweenInfo1, GoalOne)
part.Position = Vector3.new(17.995, 2.884, -0.555)
Tween1:Play()
Tween1.Completed:Wait()
end
if sipstaken == 2 then
local GoalTwo = {Size = Vector3.new(0.544, 0.67, 0.71)}
local TweenInfo2 = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Tween2 = TweenService:Create(part, TweenInfo2, GoalTwo)
part.Position = Vector3.new(17.995, 2.866, -0.555)
Tween2:Play()
Tween2.Completed:Wait()
end
if sipstaken == 3 then
local GoalThree = {Size = Vector3.new(0.366, 0.67, 0.71)}
local TweenInfo3 = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Tween3 = TweenService:Create(part, TweenInfo3, GoalThree)
part.Position = Vector3.new(17.995, 2.812, -0.555)
Tween3:Play()
Tween3.Completed:Wait()
end
wait(1)
debounce = false
end
end
end)
Gif of issue:
https://gyazo.com/c6b9cdfbf4978f21482c9eb19ba95869