It should play an animation and give you a tool but it doesn't do anything and does not give out an output? How do I fix this script? And is there any problems?
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")
local animation = script.ChefAnimation
local AnimTrack = hum:LoadAnimation(animation)
debounce = false
function onClick(click)
if debounce == false then
if player.Backpack:findFirstChild("SpringRoll")then
player.Backpack.SpringRoll:Destroy()
AnimTrack:Play()
wait(2.8)
local b = script["Cha Giò Spring Rolls"]:Clone()
b.Parent = player.Backpack
end
end
end
wait(5)
debounce = false
script.Parent.ClickDetector.MouseClick:connect(onClick)
