-
What do you want to achieve?
I want to fix my script. -
What is the issue?
The issue is that I don’t know how to fix it. -
What solutions have you tried so far?
I tried getting help from HiddenDevs but they just send emojis…
Script:
--// Services
local Services = {
Players = game:GetService("Players");
ReplicatedStorage = game:GetService("ReplicatedStorage");
TweenService = game:GetService("TweenService");
}
--// DropperSettings
local MaxIngredientsToDrop = 4
local Ingredient = Services.ReplicatedStorage.Ingredients:FindFirstChild("Chocolate")
local MixTime = 1
local DroppingCooldown = 3
--// Bools
local IsBlending = false
local CanDrop = true
local CanBlend = false
--// Dropper
local DropperPart = script.Parent.DropperPart
--// MixPart
local MixPart = script.Parent.MixPart
--// Buttons
local StartButton = script.Parent.StartButton
--// Proximity
local StartProximity = StartButton.Blend
--// Tween Info
local MixTweenSettingsStart = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut, 0, false, 0) -- Time, EasingStyle, EasingDirection, Repeat, Reverses, Delay
local MixTweenSettingsEnd = TweenInfo.new(1, Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut, 0, false, 0) -- Time, EasingStyle, EasingDirection, Repeat, Reverses, Delay
--// Functions
local numParts = 0
local function startBlending()
StartProximity.Enabled = false
IsBlending = true
Services.TweenService:Create(MixPart, MixTweenSettingsStart, {["Size"] = Vector3.new(14.546, 10.299, 12.963)}):Play()
wait(MixTweenSettingsStart.Time)
Services.TweenService:Create(MixPart, MixTweenSettingsEnd, {["Size"] = Vector3.new(0.001, 10.299, 12.963)}):Play()
wait(MixTweenSettingsEnd.Time)
IsBlending = false
StartProximity.Enabled = true
end
StartProximity.Triggered:Connect(function()
if CanDrop and CanBlend and not IsBlending then
startBlending()
end
end)
while wait(DroppingCooldown) do
numParts = #script.Parent.Ingredients:GetChildren()
if numParts == MaxIngredientsToDrop then
CanDrop = false
CanBlend = true
elseif numParts < MaxIngredientsToDrop and IsBlending == false then
CanDrop = true
CanBlend = false
local IngredientNew = Ingredient:Clone()
IngredientNew.Parent = script.Parent.Ingredients
IngredientNew.Position = DropperPart.Position
end
end
I do not get any errors. The only thing that works perfectly is the while loop. The function for blending doesn’t work.