How would i make it so if a animation already played it would not play again?

Making a animation heres the code i use i wanna make it stop when it plays once.

tool.Activated:Connect(function()
	if debounce == false  then
	loadedAnim:Play()
	wait(4)
	isFlying = not isFlying
	end

end)

Its apart of a big script so i didnt show the whole thing.

local bool = true
tool.Activated:Connect(function()
	if debounce == false  then
        if bool then
            bool = false
	        loadedAnim:Play()
        end
	    wait(4)
	    isFlying = not isFlying
	end
end)
1 Like