Hello people, I am making a chest script and I need to make it give tools to whoever clicked after the chest animation is done. Here is the script:
---Variables---
local clickdetector = script.Parent:WaitForChild("ClickDetector")
Phase0 = script.Parent.Parent.Phase0
Phase1 = script.Parent.Parent.Phase1
Phase2 = script.Parent.Parent.Phase2
Phase3 = script.Parent.Parent.Phase3
Phase4 = script.Parent.Parent.Phase4
Phase5 = script.Parent.Parent.Phase5
----------------------------------------------------------------
---Animate---
clickdetector.MouseClick:Connect(function()
Phase0.Transparency = 1
Phase1.Transparency = 0
wait(0.1)
Phase1.Transparency = 1
Phase2.Transparency = 0
wait(0.1)
Phase2.Transparency = 1
Phase3.Transparency = 0
wait(0.1)
Phase3.Transparency = 1
Phase4.Transparency = 0
wait(0.1)
Phase4.Transparency = 1
Phase5.Transparency = 0
script.Parent.ParticleEmitter.Enabled = false
wait(0.5)
--Where I want it to give tools--
end)
