This is my tool, when activated I want it to scale drink down, then move it back to the bottom of the cup again (like it’s being drank). At the moment, my script is not moving it down far enough, so theres a gap at the bottom of the cup after ~2 sips. Any help is appreciated!
local tool = script.Parent
local drink = tool:WaitForChild("Drink")
local cup = tool:WaitForChild("Handle")
local scaleDecrement = 0.1
local activationCount = 0
local function onActivated()
if tool.Name == "Cup" then
print("Cup not filled!")
return
end
local newSize = Vector3.new(
math.max(drink.Size.X - scaleDecrement, 0),
drink.Size.Y,
drink.Size.Z
)
drink.Size = newSize
local cupBottom = cup.Position.Y - (cup.Size.Y / 2)
drink.Position = Vector3.new(
drink.Position.X,
cupBottom + (drink.Size.Y / 2),
drink.Position.Z
)
activationCount += 1
if activationCount >= 5 then
drink.Transparency = 1
tool.Name = "Cup"
end
end
tool.Activated:Connect(onActivated)