everything should work and they are no errors
local function Animation(Chest, state)
local OpenAnim = Chest.Animations:WaitForChild("Open")
local controller = Chest.AnimationController
local prompt = Chest.Extra.Union.ProximityPrompt
local Open = controller:LoadAnimation(OpenAnim)
if state == "start" then
print(state) -- prints start
prompt.Enabled = false
Open:Play()
task.delay(Open.Length-.01, function()
Open:AdjustSpeed(0)
end)
-- ignore this:
local open = game.ReplicatedStorage.Sounds.ChestOpenSound:Clone()
open.Parent = Chest.UI
open:Play()
if not open.Playing then
open:Destroy()
open = nil
end
else
prompt.Enabled = true
local close = game.ReplicatedStorage.Sounds.ChestCloseSound:Clone()
close.Parent = Chest.UI
close:Play()
Open:AdjustSpeed(1)
if not close.Playing then
close:Destroy()
close = nil
end
end
end
i am guessing the main problem to be here
local function Animation(Chest, state)
local OpenAnim = Chest.Animations:WaitForChild("Open")
local controller = Chest.AnimationController
local prompt = Chest.Extra.Union.ProximityPrompt
local Open = controller:LoadAnimation(OpenAnim)
if state == "start" then
print(state) -- prints start
prompt.Enabled = false
Open:Play()
task.delay(Open.Length-.01, function()
Open:AdjustSpeed(0)
end)